/** Cooked with Flambe, https://getflambe.com */
'use strict'; (function() {
    function v(a, b) {
        function c() {}
        c.prototype = a;
        var d = new c,
        g;
        for (g in b) d[g] = b[g];
        b.toString !== Object.prototype.toString && (d.toString = b.toString);
        return d
    }
    function Wb(a) {
        return a instanceof Array ?
        function() {
            return t.iter(a)
        }: "function" == typeof a.iterator ? fa(a, a.iterator) : a.iterator
    }
    function fa(a, b) {
        if (null == b) return null;
        null == b.__id__ && (b.__id__ = ic++);
        var c;
        null == a.hx__closures__ ? a.hx__closures__ = {}: c = a.hx__closures__[b.__id__];
        null == c && (c = function() {
            return c.method.apply(c.scope, arguments)
        },
        c.scope = a, c.method = b, a.hx__closures__[b.__id__] = c);
        return c
    }
    var f = {},
    q = function() {
        return E.__string_rec(this, "")
    },
    W = function(a, b) {
        b = b.split("u").join("");
        this.r = RegExp(a, b)
    };
    f.EReg = W;
    W.__name__ = ["EReg"];
    W.prototype = {
        match: function(a) {
            this.r.global && (this.r.lastIndex = 0);
            this.r.m = this.r.exec(a);
            this.r.s = a;
            return null != this.r.m
        },
        matched: function(a) {
            if (null != this.r.m && 0 <= a && a < this.r.m.length) return this.r.m[a];
            throw "EReg::matched";
        },
        matchedPos: function() {
            if (null == this.r.m) throw "No string matched";
            return {
                pos: this.r.m.index,
                len: this.r.m[0].length
            }
        },
        split: function(a) {
            return a.replace(this.r, "#__delim__#").split("#__delim__#")
        },
        __class__: W
    };
    var X = function() {};
    f.G = X;
    X.__name__ = ["G"];
    X.saveHiScore = function(a) {
        a > X.HI_SCORE && (X.HI_SCORE = a, e.saveData("hi_score", X.HI_SCORE))
    };
    X.loadHiScore = function() {
        var a = e.loadData("hi_score");
        X.HI_SCORE = 0 < a ? a: 0
    };
    var la = function(a, b) {
        null == b && (b = 0);
        null == a && (a = 0);
        this.x = a;
        this.y = b
    };
    f["flambe.math.Point"] = la;
    la.__name__ = ["flambe", "math", "Point"];
    la.prototype = {
        __class__: la
    };
    var i = function(a, b, c) {
        i.ref = this;
        this.rootRef = a;
        this.width = b;
        this.height = c;
        i.offsetX = (e.width - b * (i.pieceWidth + i.gap)) / 2 + i.pieceWidth / 2 | 0;
        a = [];
        b = 0;
        for (c = this.height; b < c;) b++,
        a.push(function(a) {
            for (var b = [], c = 0, a = a.width; c < a;) c++,
            b.push(null);
            return b
        } (this));
        this.grid = a;
        x.canMakeAction = !0
    };
    f.Grid = i;
    i.__name__ = ["Grid"];
    i.prototype = {
        addRandPiece: function(a, b) {
            return new x(a, b, y.random(i.pieceTypes))
        },
        addBonusPieceAt: function(a, b) {
            var c = new x(b, 0, i.pieceTypes + a);
            return this.grid[0][b] = c
        },
        addRandRows: function(a) {
            for (var b = this.grid.length - 1,
            a = b - a; b > a;) {
                for (var c = 0,
                d = this.grid[b].length; c < d;) {
                    var g = c++;
                    this.grid[b][g] = this.addRandPiece(g, b)
                }
                b--
            }
        },
        getPiecesOfType: function(a) {
            for (var b = [], c = 0, d = this.grid.length; c < d;) for (var g = c++,
            j = 0,
            e = this.grid[g].length; j < e;) {
                var f = j++;
                null != this.grid[g][f] && this.grid[g][f].type == a && b.push(this.grid[g][f])
            }
            return b
        },
        pushPiecesUp: function() {
            var a = this.getPiecesAtTop();
            if (0 < a.length) for (var b = 0,
            c = a.length; b < c;) {
                var d = b++;
                if (! (a[d].type > i.pieceTypes - 1)) return ! 1
            }
            a = 0;
            for (b = this.grid.length; a < b;) for (var c = a++,
            d = 0,
            g = this.grid[c].length; d < g;) {
                var j = d++;
                null != this.grid[c][j] && (0 != c ? (this.grid[c - 1][j] = this.grid[c][j], this.grid[c - 1][j].gridY = c - 1, this.grid[c - 1][j].tweenOnPushUp(), this.grid[c][j] = null) : this.grid[c][j].type > i.pieceTypes - 1 && (this.grid[c][j].tweenOnBonusDeath(), this.grid[c][j] = null))
            }
            this.getPiecesAtTop();
            return ! 0
        },
        getPiecesAtTop: function() {
            for (var a = [], b = 0, c = this.grid[0].length; b < c;) {
                var d = b++;
                null != this.grid[0][d] && (a.push(this.grid[0][d]), this.grid[0][d].tweenOnTop())
            }
            return a
        },
        coordsInGrid: function(a, b) {
            return 0 <= a && 0 <= b && a < this.width && b < this.height
        },
        getPiece: function(a, b) {
            return this.coordsInGrid(a, b) && null != this.grid[b][a] ? this.grid[b][a] : null
        },
        neighbourOf: function(a, b) {
            var c = a.relativeCoordinates(b, 1);
            return this.getPiece(c.x | 0, c.y | 0)
        },
        neighboursOf: function(a) {
            for (var b = [], c = 0, d = i.dirs.length; c < d;) {
                var g = c++;
                b.push(this.neighbourOf(a, i.dirs[g]))
            }
            return b
        },
        getDeepMatches: function(a) {
            null == a && (a = 2);
            for (var b = [], c = [], d = 0, g = this.grid.length; d < g;) for (var j = this.grid[d++], e = 0, f = j.length; e < f;) {
                var k = e++,
                h = j[k];
                if (null != h && -1 == ma.indexOf(b, h)) {
                    for (var k = h.deepMatchingNeighbours(), i = 0, l = k.length; i < l;) {
                        var m = i++;
                        b.push(k[m])
                    }
                    if (k.length >= a && null != h) {
                        h = 0;
                        for (i = k.length; h < i;) l = h++,
                        c.push(k[l])
                    }
                }
            }
            return c
        },
        applyGravityDown: function() {
            for (var a = this.grid.length - 1,
            b = []; 0 < a;) {
                for (var c = this.grid[a], d = 0, g = c.length; d < g;) {
                    var j = d++;
                    if (null == c[j]) for (var e = a; 0 < e;) e--,
                    null != this.grid[e][j] && (this.grid[a][j] = this.grid[e][j], this.grid[a][j].gridY = a, b.push(this.grid[a][j]), this.grid[e][j] = null, e = 0)
                }
                a--
            }
            return b
        },
        slideToLeft: function() {
            for (var a = this.grid[this.grid.length - 1], b = 0, c = [], d = 0, g = a.length; d < g;) {
                var j = d++;
                if (null == a[j] && j != a.length - 1 && (b++, null != a[j + 1])) {
                    for (var j = j + 1,
                    e = a[j]; null != e;) {
                        for (var e = 0,
                        f = this.grid.length; e < f;) {
                            var k = e++;
                            null != this.grid[k][j] && (this.grid[k][j - b] = this.grid[k][j], this.grid[k][j - b].gridX = j - b, c.push(this.grid[k][j - b]), this.grid[k][j] = null)
                        }
                        j++;
                        e = a[j]
                    }
                    b = 0
                }
            }
            return c
        },
        clear: function() {
            for (var a = 0,
            b = this.grid.length; a < b;) for (var c = a++,
            d = 0,
            g = this.grid[c].length; d < g;) {
                var j = d++;
                null != this.grid[c][j] && this.grid[c][j].tweenOnGameOver();
                this.grid[c][j] = null
            }
        },
        clear2: function() {
            for (var a = 0,
            b = this.grid.length; a < b;) for (var c = a++,
            d = 0,
            g = this.grid[c].length; d < g;) {
                var j = d++;
                null != this.grid[c][j] && this.grid[c][j].tweenOnLevelEnd();
                this.grid[c][j] = null
            }
        },
        __class__: i
    };
    var x = function(a, b, c) {
        this.gridX = a;
        this.gridY = b;
        this.type = c;
        this.init()
    };
    f.Piece = x;
    x.__name__ = ["Piece"];
    x.prototype = {
        init: function() {
            var a = this;
            x.canMakeAction = !0;
            this.pieceEnt = e.addImageSprite(i.ref.rootRef, this.getX(), this.initY(), "bl" + this.type);
            this.pieceEnt.add(new ga);
            this.pieceEnt._compMap.Disposer_2.connect1(this.pieceEnt._compMap.Sprite_0.get_pointerUp(), fa(this, this.onPointerUp));
            null == x.actionSequence && (x.actionSequence = new ha, x.actionSequence.add(new P(function() {
                x.canMakeAction = !1;
                for (var a = i.ref.applyGravityDown(), c = 0, d = a.length; c < d;) {
                    var g = c++;
                    a[g].tweenOnGravityDown()
                }
            })), x.actionSequence.add(new $(0.1)), x.actionSequence.add(new P(function() {
                for (var b = i.ref.slideToLeft(), c = 0, d = b.length; c < d;) {
                    var g = c++;
                    b[g].tweenOnSlideLeft()
                }
                a.showBonusInfo()
            })), x.actionSequence.add(new P(function() {
                i.ref.rootRef._compMap.GameSceneComp_7.checkForMatches()
            })), x.actionSequence.add(new P(function() {
                x.canMakeAction = !0
            })));
            this.tweenOnInit();
            this.showBonusInfo()
        },
        onPointerUp: function() {
            if (x.canMakeAction) if (this.type > i.pieceTypes - 1) this.activateBonus3(this.type - i.pieceTypes);
            else {
                var a = this.deepMatchingNeighbours();
                if (0 < a.length) {
                    o.playSfx("pop_sfx");
                    for (var b = 0,
                    c = a.length; b < c;) {
                        var d = b++;
                        this.tweenOnRemove(a[d])
                    }
                    this.updateGrid(a);
                    a.length > i.minMatchForBonus - 1 && this.addBonus(e.rand(i.pieceTypes))
                } else this.tweenShake()
            }
        },
        updateGrid: function(a, b) {
            null == b && (b = !1);
            var c = a.length,
            d = 10 * c * c * c - 10 * c;
            b && (d = 10 * c * c);
            i.ref.rootRef._compMap.GameSceneComp_7.updateScore(d);
            var g;
            g = e.addLabel(i.ref.rootRef, this.getX(), this.getY(), "+" + d, 1.2, 1, !0)._compMap.Sprite_0;
            R.to(g, 0.5, {
                y: g.y._value - 45
            },
            0,
            function() {
                g.dispose()
            },
            m.cubeOut);
            i.ref.rootRef._compMap.Script_3.run(x.actionSequence)
        },
        addBonus: function(a) {
            var b = this;
            i.ref.rootRef._compMap.Script_3.run(new ha([new $(0.1), new P(function() {
                i.ref.addBonusPieceAt(a, b.gridX);
                i.ref.rootRef._compMap.Script_3.run(x.actionSequence)
            })]))
        },
        activateBonus3: function(a) {
            a = i.ref.getPiecesOfType(a);
            if (0 == a.length) this.tweenShake();
            else {
                for (var b = 0,
                c = a.length; b < c;) {
                    var d = b++;
                    this.tweenOnRemove(a[d])
                }
                this.tweenOnRemove(this);
                o.playSfx("bonus_sfx", 1);
                i.ref.rootRef._compMap.Script_3.run(new Ga(10, 0, 0.5));
                this.updateGrid(a, !0)
            }
        },
        showBonusInfo: function() {
            for (var a = [], b = [], c = 0, d = i.ref.grid.length; c < d;) for (var g = c++,
            j = 0,
            f = i.ref.grid[g].length; j < f;) {
                var Y = j++;
                if (null != i.ref.grid[g][Y]) {
                    i.ref.grid[g][Y].pieceEnt.disposeChildren();
                    var k = i.ref.grid[g][Y].deepMatchingNeighbours();
                    if (k.length > i.minMatchForBonus - 1 && -1 == ma.indexOf(a, i.ref.grid[g][Y])) {
                        b.push(i.ref.grid[g][Y]);
                        for (var Y = 0,
                        h = k.length; Y < h;) {
                            var l = Y++;
                            a.push(k[l])
                        }
                    }
                }
            }
            a = 0;
            for (c = b.length; a < c;) d = a++,
            e.addImageSprite(b[d].pieceEnt, (i.pieceWidth / 2 | 0) + 5, i.pieceHeight / 2 | 0, "bonus_marker")
        },
        getX: function() {
            return this.gridX * (i.pieceWidth + i.gap) + (i.gap / 2 | 0) + i.offsetX
        },
        getY: function() {
            return this.gridY * (i.pieceHeight + i.gap) + (i.gap / 2 | 0) + i.offsetY
        },
        initY: function() {
            return this.type < i.pieceTypes ? this.getY() + e.height + (i.pieceHeight / 2 | 0) - i.offsetY: -100
        },
        tweenOnInit: function() {
            this.pieceEnt._compMap.Sprite_0.y.animateTo(this.getY(), 0.4, m.bounceIn)
        },
        tweenOnRemove: function(a) {
            this.removeJitterBehavior();
            i.ref.grid[a.gridY][a.gridX] = null;
            a.pieceEnt._compMap.Sprite_0.setAlpha(0.7);
            R.to(a.pieceEnt._compMap.Sprite_0, 0.4, {
                alpha: 0.5,
                scaleX: 0,
                scaleY: 0
            },
            0,
            function() {
                a.pieceEnt.dispose()
            },
            m.backIn)
        },
        tweenOnBonusDeath: function() {
            var a = this;
            this.removeJitterBehavior();
            this.pieceEnt._compMap.Sprite_0.setAlpha(0.7);
            this.pieceEnt._compMap.Sprite_0.y.animateTo(e.height + 100, 1, m.backIn);
            R.to(this.pieceEnt._compMap.Sprite_0, 3, {
                rotation: 720
            },
            0,
            function() {
                a.pieceEnt.dispose()
            },
            m.backIn)
        },
        tweenOnLevelEnd: function() {
        	//dp_share();
            x.canMakeAction = !1
        },
        tweenOnGameOver: function() {
        	//dp_share();
            var a = this;
            this.removeJitterBehavior();
            x.canMakeAction = !1;
            R.to(this.pieceEnt._compMap.Sprite_0, 0.4, {
                y: this.getY() - 20
            },
            0,
            function() {
                a.pieceEnt._compMap.Sprite_0.y.animateTo(e.height + 100, 1, m.backIn);
                a.pieceEnt._compMap.Sprite_0.rotation.animateTo(720 * e.randSign(), 3, m.quadIn)
            },
            m.backIn)
        },
        tweenOnTop: function() {
            var a = this;
            this.type > i.pieceTypes - 1 || this.pieceEnt._compMap.Script_3.run(new ha([new $(0.6), new P(function() {
                a.pieceEnt._compMap.Sprite_0.x.set_behavior(new qa(a.getX(), 2));
                a.pieceEnt._compMap.Sprite_0.y.set_behavior(new qa(a.getY(), 2));
                if (null == i.ref.rootRef.firstChild.firstChild) {
                    var b;
                    b = e.addFillSprite(i.ref.rootRef.firstChild, 0, 0, 16711680, e.width, e.height, 0.2, !1)._compMap.Sprite_0;
                    e.addDelay(b.owner, 0.2,
                    function() {
                        0.2 == b.alpha._value ? b.alpha.set__(0) : b.alpha.set__(0.2)
                    },
                    !0)
                }
            })]))
        },
        removeJitterBehavior: function() {
            this.pieceEnt._compMap.Script_3.stopAll();
            this.pieceEnt._compMap.Sprite_0.x.set_behavior(null);
            this.pieceEnt._compMap.Sprite_0.y.set_behavior(null);
            0 == i.ref.getPiecesAtTop().length && null != i.ref.rootRef.firstChild.firstChild && i.ref.rootRef.firstChild.disposeChildren()
        },
        tweenOnSlideLeft: function() {
            var a = this;
            x.canMakeAction = !1;
            this.pieceEnt._compMap.Sprite_0.x.animateTo(this.getX(), 0.4, m.backInOut);
            R.to(this.pieceEnt._compMap.Sprite_0, 0.1, {
                rotation: 10,
                scaleX: 0.7
            },
            0.1,
            function() {
                R.to(a.pieceEnt._compMap.Sprite_0, 0.15, {
                    rotation: 0,
                    scaleX: 1
                },
                0, null, m.backOut)
            },
            m.backIn)
        },
        tweenOnPushUp: function() {
            x.canMakeAction = !1;
            R.to(this.pieceEnt._compMap.Sprite_0, 0.4, {
                y: this.getY()
            },
            0,
            function() {
                x.canMakeAction = !0
            },
            m.backIn)
        },
        tweenOnGravityDown: function() {
            var a = this;
            this.removeJitterBehavior();
            this.pieceEnt._compMap.Sprite_0.y.animateTo(this.getY(), 0.4, m.backIn);
            R.to(this.pieceEnt._compMap.Sprite_0, 0.15, {
                scaleX: 1.2,
                scaleY: 0.7
            },
            0.1,
            function() {
                R.to(a.pieceEnt._compMap.Sprite_0, 0.25, {
                    scaleX: 1,
                    scaleY: 1
                },
                0, null, m.backInOut)
            },
            m.bounceInOut)
        },
        tweenShake: function() {
            o.playSfx("no_match_sfx", 0.5);
            this.pieceEnt._compMap.Sprite_0.x.set__(this.getX());
            this.pieceEnt._compMap.Sprite_0.y.set__(this.getY());
            this.pieceEnt._compMap.Script_3.run(new Ga(10, 0, 0.3))
        },
        relativeCoordinates: function(a, b) {
            return new la(this.gridX + b * a.x, this.gridY + b * a.y)
        },
        neighbours: function() {
            return i.ref.neighboursOf(this)
        },
        matchingNeighbours: function() {
            for (var a = [], b = this.neighbours(), c, d = 0, g = b.length; d < g;) c = d++,
            c = b[c],
            null != c && c.type == this.type && this.type < i.pieceTypes && a.push(c);
            return a
        },
        deepMatchingNeighbours: function() {
            var a = [],
            b = null,
            b = function(c) {
                for (var c = c.matchingNeighbours(), d = 0, g = c.length; d < g;) {
                    var j = d++,
                    j = c[j]; - 1 == ma.indexOf(a, j) && (a.push(j), b(j))
                }
            };
            b(this);
            return a
        },
        __class__: x
    };
    var t = function() {};
    f.HxOverrides = t;
    t.__name__ = ["HxOverrides"];
    t.dateStr = function(a) {
        var b = a.getMonth() + 1,
        c = a.getDate(),
        d = a.getHours(),
        g = a.getMinutes(),
        j = a.getSeconds();
        return a.getFullYear() + "-" + (10 > b ? "0" + b: "" + b) + "-" + (10 > c ? "0" + c: "" + c) + " " + (10 > d ? "0" + d: "" + d) + ":" + (10 > g ? "0" + g: "" + g) + ":" + (10 > j ? "0" + j: "" + j)
    };
    t.strDate = function(a) {
        switch (a.length) {
        case 8:
            var a = a.split(":"),
            b = new Date;
            b.setTime(0);
            b.setUTCHours(a[0]);
            b.setUTCMinutes(a[1]);
            b.setUTCSeconds(a[2]);
            return b;
        case 10:
            return a = a.split("-"),
            new Date(a[0], a[1] - 1, a[2], 0, 0, 0);
        case 19:
            return b = a.split(" "),
            a = b[0].split("-"),
            b = b[1].split(":"),
            new Date(a[0], a[1] - 1, a[2], b[0], b[1], b[2]);
        default:
            throw "Invalid date format : " + a;
        }
    };
    t.cca = function(a, b) {
        var c = a.charCodeAt(b);
        return c != c ? void 0 : c
    };
    t.substr = function(a, b, c) {
        if (null != b && 0 != b && null != c && 0 > c) return "";
        null == c && (c = a.length);
        0 > b ? (b = a.length + b, 0 > b && (b = 0)) : 0 > c && (c = a.length + c - b);
        return a.substr(b, c)
    };
    t.remove = function(a, b) {
        var c = a.indexOf(b);
        if ( - 1 == c) return ! 1;
        a.splice(c, 1);
        return ! 0
    };
    t.iter = function(a) {
        return {
            cur: 0,
            arr: a,
            hasNext: function() {
                return this.cur < this.arr.length
            },
            next: function() {
                return this.arr[this.cur++]
            }
        }
    };
    var ma = function() {};
    f.Lambda = ma;
    ma.__name__ = ["Lambda"];
    ma.array = function(a) {
        for (var b = [], a = Wb(a)(); a.hasNext();) {
            var c = a.next();
            b.push(c)
        }
        return b
    };
    ma.count = function(a, b) {
        var c = 0;
        if (null == b) for (var d = Wb(a)(); d.hasNext();) d.next(),
        c++;
        else for (d = Wb(a)(); d.hasNext();) {
            var g = d.next();
            b(g) && c++
        }
        return c
    };
    ma.indexOf = function(a, b) {
        for (var c = 0,
        d = Wb(a)(); d.hasNext();) {
            var g = d.next();
            if (b == g) return c;
            c++
        }
        return - 1
    };
    var Va = function() {
        this.length = 0
    };
    f.List = Va;
    Va.__name__ = ["List"];
    Va.prototype = {
        add: function(a) {
            a = [a];
            null == this.h ? this.h = a: this.q[1] = a;
            this.q = a;
            this.length++
        },
        iterator: function() {
            return {
                h: this.h,
                hasNext: function() {
                    return null != this.h
                },
                next: function() {
                    if (null == this.h) return null;
                    var a = this.h[0];
                    this.h = this.h[1];
                    return a
                }
            }
        },
        __class__: Va
    };
    var Wa = function() {};
    f.Main = Wa;
    Wa.__name__ = ["Main"];
    Wa.main = function() {
        l.init();
        e.systemBgColor = 5459013; (new e(640, 960)).init.connect(Wa.onInit).once()
    };
    Wa.onInit = function() {
        X.loadHiScore();
        e.buttonClickSfx = "button_click_sfx";
        e.goToScene((new Ha).root)
    };
    var Cb = function() {};
    f.IMap = Cb;
    Cb.__name__ = ["IMap"];
    Math.__name__ = ["Math"];
    var z = function() {};
    f.Reflect = z;
    z.__name__ = ["Reflect"];
    z.field = function(a, b) {
        try {
            return a[b]
        } catch(c) {
            return null
        }
    };
    z.getProperty = function(a, b) {
        var c;
        return null == a ? null: a.__properties__ && (c = a.__properties__["get_" + b]) ? a[c]() : a[b]
    };
    z.callMethod = function(a, b, c) {
        return b.apply(a, c)
    };
    z.fields = function(a) {
        var b = [];
        if (null != a) {
            var c = Object.prototype.hasOwnProperty,
            d;
            for (d in a)"__id__" != d && "hx__closures__" != d && c.call(a, d) && b.push(d)
        }
        return b
    };
    z.isFunction = function(a) {
        return "function" == typeof a && !(a.__name__ || a.__ename__)
    };
    z.deleteField = function(a, b) {
        if (!Object.prototype.hasOwnProperty.call(a, b)) return ! 1;
        delete a[b];
        return ! 0
    };
    var y = function() {};
    f.Std = y;
    y.__name__ = ["Std"];
    y.is = function(a, b) {
        return E.__instanceof(a, b)
    };
    y.string = function(a) {
        return E.__string_rec(a, "")
    };
    y["int"] = function(a) {
        return a | 0
    };
    y.parseInt = function(a) {
        var b = parseInt(a, 10);
        if (0 == b && (120 == t.cca(a, 1) || 88 == t.cca(a, 1))) b = parseInt(a);
        return isNaN(b) ? null: b
    };
    y.parseFloat = function(a) {
        return parseFloat(a)
    };
    y.random = function(a) {
        return 0 >= a ? 0 : Math.floor(Math.random() * a)
    };
    var Xa = function() {
        this.b = ""
    };
    f.StringBuf = Xa;
    Xa.__name__ = ["StringBuf"];
    Xa.prototype = {
        add: function(a) {
            this.b += y.string(a)
        },
        __class__: Xa
    };
    var F = function() {};
    f.StringTools = F;
    F.__name__ = ["StringTools"];
    F.startsWith = function(a, b) {
        return a.length >= b.length && t.substr(a, 0, b.length) == b
    };
    F.replace = function(a, b, c) {
        return a.split(b).join(c)
    };
    F.fastCodeAt = function(a, b) {
        return a.charCodeAt(b)
    };
    var p = f.ValueType = {
        __ename__: ["ValueType"],
        __constructs__: "TNull,TInt,TFloat,TBool,TObject,TFunction,TClass,TEnum,TUnknown".split(",")
    };
    p.TNull = ["TNull", 0];
    p.TNull.toString = q;
    p.TNull.__enum__ = p;
    p.TInt = ["TInt", 1];
    p.TInt.toString = q;
    p.TInt.__enum__ = p;
    p.TFloat = ["TFloat", 2];
    p.TFloat.toString = q;
    p.TFloat.__enum__ = p;
    p.TBool = ["TBool", 3];
    p.TBool.toString = q;
    p.TBool.__enum__ = p;
    p.TObject = ["TObject", 4];
    p.TObject.toString = q;
    p.TObject.__enum__ = p;
    p.TFunction = ["TFunction", 5];
    p.TFunction.toString = q;
    p.TFunction.__enum__ = p;
    p.TClass = function(a) {
        a = ["TClass", 6, a];
        a.__enum__ = p;
        a.toString = q;
        return a
    };
    p.TEnum = function(a) {
        a = ["TEnum", 7, a];
        a.__enum__ = p;
        a.toString = q;
        return a
    };
    p.TUnknown = ["TUnknown", 8];
    p.TUnknown.toString = q;
    p.TUnknown.__enum__ = p;
    var D = function() {};
    f.Type = D;
    D.__name__ = ["Type"];
    D.getClassName = function(a) {
        return a.__name__.join(".")
    };
    D.getEnumName = function(a) {
        return a.__ename__.join(".")
    };
    D.resolveClass = function(a) {
        a = f[a];
        return null == a || !a.__name__ ? null: a
    };
    D.resolveEnum = function(a) {
        a = f[a];
        return null == a || !a.__ename__ ? null: a
    };
    D.createEmptyInstance = function(a) {
        function b() {}
        b.prototype = a.prototype;
        return new b
    };
    D.createEnum = function(a, b, c) {
        var d = z.field(a, b);
        if (null == d) throw "No such constructor " + b;
        if (z.isFunction(d)) {
            if (null == c) throw "Constructor " + b + " need parameters";
            return d.apply(a, c)
        }
        if (null != c && 0 != c.length) throw "Constructor " + b + " does not need parameters";
        return d
    };
    D.getEnumConstructs = function(a) {
        return a.__constructs__.slice()
    };
    D["typeof"] = function(a) {
        switch (typeof a) {
        case "boolean":
            return p.TBool;
        case "string":
            return p.TClass(String);
        case "number":
            return Math.ceil(a) == a % 2147483648 ? p.TInt: p.TFloat;
        case "object":
            if (null == a) return p.TNull;
            var b = a.__enum__;
            if (null != b) return p.TEnum(b);
            a = a instanceof Array && null == a.__enum__ ? Array: a.__class__;
            return null != a ? p.TClass(a) : p.TObject;
        case "function":
            return a.__name__ || a.__ename__ ? p.TObject: p.TFunction;
        case "undefined":
            return p.TNull;
        default:
            return p.TUnknown
        }
    };
    var da = function() {};
    f["flambe.util.Disposable"] = da;
    da.__name__ = ["flambe", "util", "Disposable"];
    da.prototype = {
        __class__: da
    };
    var C = function() {};
    f["flambe.Component"] = C;
    C.__name__ = ["flambe", "Component"];
    C.__interfaces__ = [da];
    C.prototype = {
        onAdded: function() {},
        onRemoved: function() {},
        onUpdate: function() {},
        dispose: function() {
            null != this.owner && this.owner.remove(this)
        },
        get_name: function() {
            return null
        },
        init: function(a, b) {
            this.owner = a;
            this.next = b
        },
        __class__: C,
        __properties__: {
            get_name: "get_name"
        }
    };
    var ra = function() {
        this._disposables = []
    };
    f["flambe.Disposer"] = ra;
    ra.__name__ = ["flambe", "Disposer"];
    ra.__super__ = C;
    ra.prototype = v(C.prototype, {
        get_name: function() {
            return "Disposer_2"
        },
        add: function(a) {
            this._disposables.push(a);
            return this
        },
        connect1: function(a, b) {
            this.add(a.connect(b));
            return this
        },
        onRemoved: function() {
            this.freeDisposables()
        },
        dispose: function() {
            C.prototype.dispose.call(this);
            this.freeDisposables()
        },
        freeDisposables: function() {
            var a = this._disposables;
            this._disposables = [];
            for (var b = 0; b < a.length;) {
                var c = a[b]; ++b;
                c.dispose()
            }
        },
        __class__: ra
    });
    var G = function() {
        this.parent = this.firstChild = this.next = this.firstComponent = null;
        this._compMap = {}
    };
    f["flambe.Entity"] = G;
    G.__name__ = ["flambe", "Entity"];
    G.__interfaces__ = [da];
    G.prototype = {
        add: function(a) {
            null != a.owner && a.owner.remove(a);
            var b = a.get_name(),
            c = this._compMap[b];
            null != c && this.remove(c);
            this._compMap[b] = a;
            b = null;
            for (c = this.firstComponent; null != c;) b = c,
            c = c.next;
            null != b ? b.next = a: this.firstComponent = a;
            a.init(this, null);
            a.onAdded();
            return this
        },
        remove: function(a) {
            for (var b = null,
            c = this.firstComponent; null != c;) {
                var d = c.next;
                if (c == a) return null == b ? this.firstComponent = d: b.init(this, d),
                delete this._compMap[c.get_name()],
                c.onRemoved(),
                c.init(null, null),
                !0;
                b = c;
                c = d
            }
            return ! 1
        },
        addChild: function(a, b) {
            null == b && (b = !0);
            null != a.parent && a.parent.removeChild(a);
            a.parent = this;
            if (b) {
                for (var c = null,
                d = this.firstChild; null != d;) c = d,
                d = d.next;
                null != c ? c.next = a: this.firstChild = a
            } else a.next = this.firstChild,
            this.firstChild = a;
            return this
        },
        removeChild: function(a) {
            for (var b = null,
            c = this.firstChild; null != c;) {
                var d = c.next;
                if (c == a) {
                    null == b ? this.firstChild = d: b.next = d;
                    c.parent = null;
                    c.next = null;
                    break
                }
                b = c;
                c = d
            }
        },
        disposeChildren: function() {
            for (; null != this.firstChild;) this.firstChild.dispose()
        },
        dispose: function() {
            for (null != this.parent && this.parent.removeChild(this); null != this.firstComponent;) this.firstComponent.dispose();
            this.disposeChildren()
        },
        __class__: G
    };
    var Xb = function() {};
    f["flambe.util.PackageLog"] = Xb;
    Xb.__name__ = ["flambe", "util", "PackageLog"];
    var Db = function() {};
    f["flambe.platform.Platform"] = Db;
    Db.__name__ = ["flambe", "platform", "Platform"];
    Db.prototype = {
        __class__: Db
    };
    var na = function() {};
    f["flambe.platform.html.HtmlPlatform"] = na;
    na.__name__ = ["flambe", "platform", "html", "HtmlPlatform"];
    na.__interfaces__ = [Db];
    na.prototype = {
        init: function() {
            var a = this;
            n.fixAndroidMath();
            var b = null;
            try {
                b = window.flambe.canvas
            } catch(c) {}
            b.setAttribute("tabindex", "0");
            b.style.outlineStyle = "none";
            b.style.webkitTapHighlightColor = "transparent";
            b.setAttribute("moz-opaque", "true");
            this._stage = new xa(b);
            this._pointer = new I;
            this._mouse = new Ya(this._pointer, b);
            this._renderer = this.createRenderer(b);
            this.mainLoop = new ya;
            this.musicPlaying = !1;
            this._canvas = b;
            this._container = b.parentElement;
            this._container.style.overflow = "visible";
            this._container.style.position = "relative";
            this._container.style.msTouchAction = "none";
            var d = 0,
            g = function(c) {
                if (! (1E3 > c.timeStamp - d)) {
                    var g = b.getBoundingClientRect(),
                    j = a.getX(c, g),
                    g = a.getY(c, g);
                    switch (c.type) {
                    case "mousedown":
                        c.target == b && (c.preventDefault(), a._mouse.submitDown(j, g, c.button), b.focus());
                        break;
                    case "mousemove":
                        a._mouse.submitMove(j, g);
                        break;
                    case "mouseup":
                        a._mouse.submitUp(j, g, c.button);
                        break;
                    case "mousewheel":
                    case "DOMMouseScroll":
                        a._mouse.submitScroll(j, g, "mousewheel" == c.type ? c.wheelDelta / 40 : -c.detail) && c.preventDefault()
                    }
                }
            };
            window.addEventListener("mousedown", g, !1);
            window.addEventListener("mousemove", g, !1);
            window.addEventListener("mouseup", g, !1);
            b.addEventListener("mousewheel", g, !1);
            b.addEventListener("DOMMouseScroll", g, !1);
            b.addEventListener("contextmenu",
            function(a) {
                a.preventDefault()
            },
            !1);
            var j = "undefined" != typeof window.ontouchstart,
            g = "msMaxTouchPoints" in window.navigator && 1 < window.navigator.msMaxTouchPoints;
            if (j || g) {
                var e = new Za(this._pointer, j ? 4 : window.navigator.msMaxTouchPoints);
                this._touch = e;
                g = function(b) {
                    var c;
                    c = j ? b.changedTouches: [b];
                    var g = b.target.getBoundingClientRect();
                    d = b.timeStamp;
                    switch (b.type) {
                    case "touchstart":
                    case "MSPointerDown":
                    case "pointerdown":
                        b.preventDefault();
                        n.SHOULD_HIDE_MOBILE_BROWSER && n.hideMobileBrowser();
                        for (b = 0; b < c.length;) {
                            var f = c[b]; ++b;
                            var k = a.getX(f, g),
                            Y = a.getY(f, g);
                            e.submitDown((j ? f.identifier: f.pointerId) | 0, k, Y)
                        }
                        break;
                    case "touchmove":
                    case "MSPointerMove":
                    case "pointermove":
                        b.preventDefault();
                        for (b = 0; b < c.length;) f = c[b],
                        ++b,
                        k = a.getX(f, g),
                        Y = a.getY(f, g),
                        e.submitMove((j ? f.identifier: f.pointerId) | 0, k, Y);
                        break;
                    case "touchend":
                    case "touchcancel":
                    case "MSPointerUp":
                    case "pointerup":
                        for (b = 0; b < c.length;) f = c[b],
                        ++b,
                        k = a.getX(f, g),
                        Y = a.getY(f, g),
                        e.submitUp((j ? f.identifier: f.pointerId) | 0, k, Y)
                    }
                };
                j ? (b.addEventListener("touchstart", g, !1), b.addEventListener("touchmove", g, !1), b.addEventListener("touchend", g, !1), b.addEventListener("touchcancel", g, !1)) : (b.addEventListener("MSPointerDown", g, !1), b.addEventListener("MSPointerMove", g, !1), b.addEventListener("MSPointerUp", g, !1))
            } else this._touch = new $a;
            var f = window.onerror;
            window.onerror = function(a, b, c) {
                l.uncaughtError.emit(a);
                return null != f ? f(a, b, c) : !1
            };
            var k = n.loadExtension("hidden", window.document);
            null != k.value ? (g = function() {
                l.hidden.set__(z.field(window.document, k.field))
            },
            g(null), window.document.addEventListener(k.prefix + "visibilitychange", g, !1)) : (g = function(a) {
                l.hidden.set__("pagehide" == a.type)
            },
            window.addEventListener("pageshow", g, !1), window.addEventListener("pagehide", g, !1));
            l.hidden.get_changed().connect(function(b) {
                b || (a._skipFrame = !0)
            });
            this._skipFrame = !1;
            this._lastUpdate = Date.now();
            var h = n.loadExtension("requestAnimationFrame").value,
            g = n.loadExtension("requestAnimationFrame").prefix;
            if (null != h && "webkit" != g) {
                var i = window.performance,
                m = null != i && n.polyfill("now", i);
                m ? this._lastUpdate = i.now() : null;
                var o = null,
                o = function(c) {
                    a.update(m ? i.now() : c);
                    h(o, b)
                };
                h(o, b)
            } else window.setInterval(function() {
                a.update(Date.now())
            },
            16);
            Ia.info("Initialized HTML platform", ["renderer", this._renderer.get_type()])
        },
        loadAssetPack: function(a) {
            return (new u(this, a)).promise
        },
        getStage: function() {
            return this._stage
        },
        getStorage: function() {
            if (null == this._storage) {
                var a = Yb.getLocalStorage();
                this._storage = null != a ? new ab(a) : new bb
            }
            return this._storage
        },
        update: function(a) {
            var b = (a - this._lastUpdate) / 1E3;
            this._lastUpdate = a;
            l.hidden._value || (this._skipFrame ? this._skipFrame = !1 : (this.mainLoop.update(b), this.mainLoop.render(this._renderer)))
        },
        getPointer: function() {
            return this._pointer
        },
        getRenderer: function() {
            return this._renderer
        },
        getX: function(a, b) {
            return (a.clientX - b.left) * this._stage.get_width() / b.width
        },
        getY: function(a, b) {
            return (a.clientY - b.top) * this._stage.get_height() / b.height
        },
        createRenderer: function(a) {
            return new za(a)
        },
        __class__: na
    };
    var K = function(a, b) {
        this._value = a;
        this._changed = null != b ? new Ja(b) : null
    };
    f["flambe.util.Value"] = K;
    K.__name__ = ["flambe", "util", "Value"];
    K.prototype = {
        watch: function(a) {
            a(this._value, this._value);
            return this.get_changed().connect(a)
        },
        set__: function(a) {
            var b = this._value;
            a != b && (this._value = a, null != this._changed && this._changed.emit(a, b));
            return a
        },
        get_changed: function() {
            null == this._changed && (this._changed = new Ja);
            return this._changed
        },
        __class__: K,
        __properties__: {
            get_changed: "get_changed",
            set__: "set__"
        }
    };
    var Aa = function(a, b) {
        this._next = null;
        this._signal = a;
        this._listener = b;
        this.stayInList = !0
    };
    f["flambe.util.SignalConnection"] = Aa;
    Aa.__name__ = ["flambe", "util", "SignalConnection"];
    Aa.__interfaces__ = [da];
    Aa.prototype = {
        once: function() {
            this.stayInList = !1;
            return this
        },
        dispose: function() {
            null != this._signal && (this._signal.disconnect(this), this._signal = null)
        },
        __class__: Aa
    };
    var H = function(a) {
        this._head = null != a ? new Aa(this, a) : null;
        this._deferredTasks = null
    };
    f["flambe.util.SignalBase"] = H;
    H.__name__ = ["flambe", "util", "SignalBase"];
    H.prototype = {
        connectImpl: function(a, b) {
            var c = this,
            d = new Aa(this, a);
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function() {
                c.listAdd(d, b)
            }) : this.listAdd(d, b);
            return d
        },
        disconnect: function(a) {
            var b = this;
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function() {
                b.listRemove(a)
            }) : this.listRemove(a)
        },
        defer: function(a) {
            for (var b = null,
            c = this._deferredTasks; null != c;) b = c,
            c = c.next;
            a = new Eb(a);
            null != b ? b.next = a: this._deferredTasks = a
        },
        willEmit: function() {
            var a = this._head;
            this._head = H.DISPATCHING_SENTINEL;
            return a
        },
        didEmit: function(a) {
            this._head = a;
            a = this._deferredTasks;
            for (this._deferredTasks = null; null != a;) a.fn(),
            a = a.next
        },
        listAdd: function(a, b) {
            if (b) a._next = this._head,
            this._head = a;
            else {
                for (var c = null,
                d = this._head; null != d;) c = d,
                d = d._next;
                null != c ? c._next = a: this._head = a
            }
        },
        listRemove: function(a) {
            for (var b = null,
            c = this._head; null != c;) {
                if (c == a) {
                    a = c._next;
                    null == b ? this._head = a: b._next = a;
                    break
                }
                b = c;
                c = c._next
            }
        },
        __class__: H
    };
    var Ja = function(a) {
        H.call(this, a)
    };
    f["flambe.util.Signal2"] = Ja;
    Ja.__name__ = ["flambe", "util", "Signal2"];
    Ja.__super__ = H;
    Ja.prototype = v(H.prototype, {
        connect: function(a, b) {
            null == b && (b = !1);
            return this.connectImpl(a, b)
        },
        emit: function(a, b) {
            var c = this;
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function() {
                c.emitImpl(a, b)
            }) : this.emitImpl(a, b)
        },
        emitImpl: function(a, b) {
            for (var c = this.willEmit(), d = c; null != d;) d._listener(a, b),
            d.stayInList || d.dispose(),
            d = d._next;
            this.didEmit(c)
        },
        __class__: Ja
    });
    var A = function(a) {
        H.call(this, a)
    };
    f["flambe.util.Signal1"] = A;
    A.__name__ = ["flambe", "util", "Signal1"];
    A.__super__ = H;
    A.prototype = v(H.prototype, {
        connect: function(a, b) {
            null == b && (b = !1);
            return this.connectImpl(a, b)
        },
        emit: function(a) {
            var b = this;
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function() {
                b.emitImpl(a)
            }) : this.emitImpl(a)
        },
        emitImpl: function(a) {
            for (var b = this.willEmit(), c = b; null != c;) c._listener(a),
            c.stayInList || c.dispose(),
            c = c._next;
            this.didEmit(b)
        },
        __class__: A
    });
    var B = function(a, b) {
        this._behavior = null;
        K.call(this, a, b)
    };
    f["flambe.animation.AnimatedFloat"] = B;
    B.__name__ = ["flambe", "animation", "AnimatedFloat"];
    B.__super__ = K;
    B.prototype = v(K.prototype, {
        set__: function(a) {
            this._behavior = null;
            return K.prototype.set__.call(this, a)
        },
        update: function(a) {
            null != this._behavior && (K.prototype.set__.call(this, this._behavior.update(a)), this._behavior.isComplete() && (this._behavior = null))
        },
        animateTo: function(a, b, c) {
            this.set_behavior(new Ka(this._value, a, b, c))
        },
        set_behavior: function(a) {
            this._behavior = a;
            this.update(0);
            return a
        },
        __class__: B,
        __properties__: v(K.prototype.__properties__, {
            set_behavior: "set_behavior"
        })
    });
    var l = function() {};
    f["flambe.System"] = l;
    l.__name__ = ["flambe", "System"];
    l.init = function() {
        l._calledInit || (l._platform.init(), l._calledInit = !0)
    };
    l.loadAssetPack = function(a) {
        return l._platform.loadAssetPack(a)
    };
    var Ia = function() {};
    f["flambe.Log"] = Ia;
    Ia.__name__ = ["flambe", "Log"];
    Ia.info = function() {
        null
    };
    Ia.__super__ = Xb;
    Ia.prototype = v(Xb.prototype, {
        __class__: Ia
    });
    var Fb = function() {
        this._realDt = 0
    };
    f["flambe.SpeedAdjuster"] = Fb;
    Fb.__name__ = ["flambe", "SpeedAdjuster"];
    Fb.__super__ = C;
    Fb.prototype = v(C.prototype, {
        get_name: function() {
            return "SpeedAdjuster_6"
        },
        onUpdate: function(a) {
            0 < this._realDt && (a = this._realDt, this._realDt = 0);
            this.scale.update(a)
        },
        __class__: Fb
    });
    var cb = function() {};
    f["flambe.animation.Behavior"] = cb;
    cb.__name__ = ["flambe", "animation", "Behavior"];
    cb.prototype = {
        __class__: cb
    };
    var m = function() {};
    f["flambe.animation.Ease"] = m;
    m.__name__ = ["flambe", "animation", "Ease"];
    m.linear = function(a) {
        return a
    };
    m.quadIn = function(a) {
        return a * a
    };
    m.quadOut = function(a) {
        return a * (2 - a)
    };
    m.cubeOut = function(a) {
        return 1 + --a * a * a
    };
    m.bounceIn = function(a) {
        a = 1 - a;
        return 0.36363636363636365 > a ? 1 - 7.5625 * a * a: 0.7272727272727273 > a ? 1 - (7.5625 * (a - 0.5454545454545454) * (a - 0.5454545454545454) + 0.75) : 0.9090909090909091 > a ? 1 - (7.5625 * (a - 0.8181818181818182) * (a - 0.8181818181818182) + 0.9375) : 1 - (7.5625 * (a - 0.9545454545454546) * (a - 0.9545454545454546) + 0.984375)
    };
    m.bounceOut = function(a) {
        return 0.36363636363636365 > a ? 7.5625 * a * a: 0.7272727272727273 > a ? 7.5625 * (a - 0.5454545454545454) * (a - 0.5454545454545454) + 0.75 : 0.9090909090909091 > a ? 7.5625 * (a - 0.8181818181818182) * (a - 0.8181818181818182) + 0.9375 : 7.5625 * (a - 0.9545454545454546) * (a - 0.9545454545454546) + 0.984375
    };
    m.bounceInOut = function(a) {
        if (0.5 > a) return a = 1 - 2 * a,
        0.36363636363636365 > a ? (1 - 7.5625 * a * a) / 2 : 0.7272727272727273 > a ? (1 - (7.5625 * (a - 0.5454545454545454) * (a - 0.5454545454545454) + 0.75)) / 2 : 0.9090909090909091 > a ? (1 - (7.5625 * (a - 0.8181818181818182) * (a - 0.8181818181818182) + 0.9375)) / 2 : (1 - (7.5625 * (a - 0.9545454545454546) * (a - 0.9545454545454546) + 0.984375)) / 2;
        a = 2 * a - 1;
        return 0.36363636363636365 > a ? 7.5625 * a * a / 2 + 0.5 : 0.7272727272727273 > a ? (7.5625 * (a - 0.5454545454545454) * (a - 0.5454545454545454) + 0.75) / 2 + 0.5 : 0.9090909090909091 > a ? (7.5625 * (a - 0.8181818181818182) * (a - 0.8181818181818182) + 0.9375) / 2 + 0.5 : (7.5625 * (a - 0.9545454545454546) * (a - 0.9545454545454546) + 0.984375) / 2 + 0.5
    };
    m.backIn = function(a) {
        return a * a * (2.70158 * a - 1.70158)
    };
    m.backOut = function(a) {
        return 1 - --a * a * ( - 2.70158 * a - 1.70158)
    };
    m.backInOut = function(a) {
        a *= 2;
        if (1 > a) return a * a * (2.70158 * a - 1.70158) / 2;
        a -= 2;
        return (1 - a * a * ( - 2.70158 * a - 1.70158)) / 2 + 0.5
    };
    var qa = function(a, b) {
        this.base = a;
        this.strength = b
    };
    f["flambe.animation.Jitter"] = qa;
    qa.__name__ = ["flambe", "animation", "Jitter"];
    qa.__interfaces__ = [cb];
    qa.prototype = {
        update: function() {
            return this.base + 2 * Math.random() * this.strength - this.strength
        },
        isComplete: function() {
            return ! 1
        },
        __class__: qa
    };
    var Ka = function(a, b, c, d) {
        this._from = a;
        this._to = b;
        this._duration = c;
        this.elapsed = 0;
        this._easing = null != d ? d: m.linear
    };
    f["flambe.animation.Tween"] = Ka;
    Ka.__name__ = ["flambe", "animation", "Tween"];
    Ka.__interfaces__ = [cb];
    Ka.prototype = {
        update: function(a) {
            this.elapsed += a;
            return this.elapsed >= this._duration ? this._to: this._from + (this._to - this._from) * this._easing(this.elapsed / this._duration)
        },
        isComplete: function() {
            return this.elapsed >= this._duration
        },
        __class__: Ka
    };
    var sa = function() {};
    f["flambe.asset.Asset"] = sa;
    sa.__name__ = ["flambe", "asset", "Asset"];
    sa.__interfaces__ = [da];
    sa.prototype = {
        __class__: sa
    };
    var h = f["flambe.asset.AssetFormat"] = {
        __ename__: ["flambe", "asset", "AssetFormat"],
        __constructs__: "WEBP,JXR,PNG,JPG,GIF,DDS,PVR,PKM,MP3,M4A,OPUS,OGG,WAV,Data".split(",")
    };
    h.WEBP = ["WEBP", 0];
    h.WEBP.toString = q;
    h.WEBP.__enum__ = h;
    h.JXR = ["JXR", 1];
    h.JXR.toString = q;
    h.JXR.__enum__ = h;
    h.PNG = ["PNG", 2];
    h.PNG.toString = q;
    h.PNG.__enum__ = h;
    h.JPG = ["JPG", 3];
    h.JPG.toString = q;
    h.JPG.__enum__ = h;
    h.GIF = ["GIF", 4];
    h.GIF.toString = q;
    h.GIF.__enum__ = h;
    h.DDS = ["DDS", 5];
    h.DDS.toString = q;
    h.DDS.__enum__ = h;
    h.PVR = ["PVR", 6];
    h.PVR.toString = q;
    h.PVR.__enum__ = h;
    h.PKM = ["PKM", 7];
    h.PKM.toString = q;
    h.PKM.__enum__ = h;
    h.MP3 = ["MP3", 8];
    h.MP3.toString = q;
    h.MP3.__enum__ = h;
    h.M4A = ["M4A", 9];
    h.M4A.toString = q;
    h.M4A.__enum__ = h;
    h.OPUS = ["OPUS", 10];
    h.OPUS.toString = q;
    h.OPUS.__enum__ = h;
    h.OGG = ["OGG", 11];
    h.OGG.toString = q;
    h.OGG.__enum__ = h;
    h.WAV = ["WAV", 12];
    h.WAV.toString = q;
    h.WAV.__enum__ = h;
    h.Data = ["Data", 13];
    h.Data.toString = q;
    h.Data.__enum__ = h;
    var Gb = function(a, b, c, d) {
        this.name = a;
        this.url = b;
        this.format = c;
        this.bytes = d
    };
    f["flambe.asset.AssetEntry"] = Gb;
    Gb.__name__ = ["flambe", "asset", "AssetEntry"];
    Gb.prototype = {
        __class__: Gb
    };
    var db = function() {};
    f["flambe.asset.AssetPack"] = db;
    db.__name__ = ["flambe", "asset", "AssetPack"];
    db.__interfaces__ = [da];
    db.prototype = {
        __class__: db
    };
    var eb = function() {};
    f["flambe.asset.File"] = eb;
    eb.__name__ = ["flambe", "asset", "File"];
    eb.__interfaces__ = [sa];
    eb.prototype = {
        __class__: eb
    };
    var S = function() {
        this._localBase = this._remoteBase = null;
        this._entries = []
    };
    f["flambe.asset.Manifest"] = S;
    S.__name__ = ["flambe", "asset", "Manifest"];
    S.fromAssets = function(a, b) {
        null == b && (b = !0);
        var c = z.field(Zb.getType(S).assets[0], a);
        if (null == c) {
            if (b) throw L.withFields("Missing asset pack", ["name", a]);
            return null
        }
        var d = new S;
        d.set_localBase("assets");
        for (var g = 0; g < c.length;) {
            var j = c[g]; ++g;
            var e = j.name,
            f = a + "/" + e + "?v=" + y.string(j.md5),
            k = S.inferFormat(e);
            k != h.Data && (e = L.removeFileExtension(e));
            d.add(e, f, j.bytes, k)
        }
        return d
    };
    S.inferFormat = function(a) {
        a = L.getUrlExtension(a);
        if (null != a) switch (a.toLowerCase()) {
        case "gif":
            return h.GIF;
        case "jpg":
        case "jpeg":
            return h.JPG;
        case "jxr":
        case "wdp":
            return h.JXR;
        case "png":
            return h.PNG;
        case "webp":
            return h.WEBP;
        case "dds":
            return h.DDS;
        case "pvr":
            return h.PVR;
        case "pkm":
            return h.PKM;
        case "m4a":
            return h.M4A;
        case "mp3":
            return h.MP3;
        case "ogg":
            return h.OGG;
        case "opus":
            return h.OPUS;
        case "wav":
            return h.WAV
        } else null;
        return h.Data
    };
    S.prototype = {
        add: function(a, b, c, d) {
            null == c && (c = 0);
            null == d && (d = S.inferFormat(b));
            a = new Gb(a, b, d, c);
            this._entries.push(a);
            return a
        },
        iterator: function() {
            return t.iter(this._entries)
        },
        getFullURL: function(a) {
            var b;
            b = null != this.get_remoteBase() && S._supportsCrossOrigin ? this.get_remoteBase() : this.get_localBase();
            return null != b ? L.joinPath(b, a.url) : a.url
        },
        get_localBase: function() {
            return this._localBase
        },
        set_localBase: function(a) {
            null != a && $b.that(!F.startsWith(a, "http://") && !F.startsWith(a, "https://"), "localBase must be a path on the same domain, NOT starting with http(s)://", null);
            return this._localBase = a
        },
        get_remoteBase: function() {
            return this._remoteBase
        },
        __class__: S,
        __properties__: {
            get_remoteBase: "get_remoteBase",
            set_localBase: "set_localBase",
            get_localBase: "get_localBase"
        }
    };
    var Q = f["flambe.display.BlendMode"] = {
        __ename__: ["flambe", "display", "BlendMode"],
        __constructs__: ["Normal", "Add", "Mask", "Copy"]
    };
    Q.Normal = ["Normal", 0];
    Q.Normal.toString = q;
    Q.Normal.__enum__ = Q;
    Q.Add = ["Add", 1];
    Q.Add.toString = q;
    Q.Add.__enum__ = Q;
    Q.Mask = ["Mask", 2];
    Q.Mask.toString = q;
    Q.Mask.__enum__ = Q;
    Q.Copy = ["Copy", 3];
    Q.Copy.toString = q;
    Q.Copy.__enum__ = Q;
    var r = function() {
        this.blendMode = this.scissor = null;
        var a = this;
        this._flags = 139;
        this._localMatrix = new Hb;
        var b = function() {
            a._flags |= 12
        };
        this.x = new B(0, b);
        this.y = new B(0, b);
        this.rotation = new B(0, b);
        this.scaleX = new B(1, b);
        this.scaleY = new B(1, b);
        this.anchorX = new B(0, b);
        this.anchorY = new B(0, b);
        this.alpha = new B(1)
    };
    f["flambe.display.Sprite"] = r;
    r.__name__ = ["flambe", "display", "Sprite"];
    r.hitTest = function(a, b, c) {
        var d = a._compMap.Sprite_0;
        if (null != d) {
            if (3 != (d._flags & 3)) return null;
            d.getLocalMatrix().inverseTransform(b, c, r._scratchPoint) && (b = r._scratchPoint.x, c = r._scratchPoint.y);
            var g = d.scissor;
            if (null != g && !g.contains(b, c)) return null
        }
        a = r.hitTestBackwards(a.firstChild, b, c);
        return null != a ? a: null != d && d.containsLocal(b, c) ? d: null
    };
    r.render = function(a, b) {
        var c = a._compMap.Sprite_0;
        if (null != c) {
            var d = c.alpha._value;
            if (0 == (c._flags & 1) || 0 >= d) return;
            b.save();
            1 > d && b.multiplyAlpha(d);
            null != c.blendMode && b.setBlendMode(c.blendMode);
            var d = c.getLocalMatrix(),
            g = d.m02,
            j = d.m12;
            0 != (c._flags & 128) && (g = Math.round(g), j = Math.round(j));
            b.transform(d.m00, d.m10, d.m01, d.m11, g, j);
            d = c.scissor;
            null != d && b.applyScissor(d.x, d.y, d.width, d.height);
            c.draw(b)
        }
        d = a._compMap.Director_5;
        if (null != d) {
            d = d.occludedScenes;
            for (g = 0; g < d.length;) j = d[g],
            ++g,
            r.render(j, b)
        }
        for (d = a.firstChild; null != d;) g = d.next,
        r.render(d, b),
        d = g;
        null != c && b.restore()
    };
    r.hitTestBackwards = function(a, b, c) {
        if (null != a) {
            var d = r.hitTestBackwards(a.next, b, c);
            return null != d ? d: r.hitTest(a, b, c)
        }
        return null
    };
    r.__super__ = C;
    r.prototype = v(C.prototype, {
        get_name: function() {
            return "Sprite_0"
        },
        getNaturalWidth: function() {
            return 0
        },
        getNaturalHeight: function() {
            return 0
        },
        containsLocal: function(a, b) {
            return 0 <= a && a < this.getNaturalWidth() && 0 <= b && b < this.getNaturalHeight()
        },
        getLocalMatrix: function() {
            0 != (this._flags & 4) && (this._flags &= -5, this._localMatrix.compose(this.x._value, this.y._value, this.scaleX._value, this.scaleY._value, 3.141592653589793 * this.rotation._value / 180), this._localMatrix.translate( - this.anchorX._value, -this.anchorY._value));
            return this._localMatrix
        },
        centerAnchor: function() {
            this.anchorX.set__(this.getNaturalWidth() / 2);
            this.anchorY.set__(this.getNaturalHeight() / 2);
            return this
        },
        setXY: function(a, b) {
            this.x.set__(a);
            this.y.set__(b);
            return this
        },
        setAlpha: function(a) {
            this.alpha.set__(a);
            return this
        },
        setRotation: function(a) {
            this.rotation.set__(a);
            return this
        },
        setScale: function(a) {
            this.scaleX.set__(a);
            this.scaleY.set__(a);
            return this
        },
        onAdded: function() {
            0 != (this._flags & 256) && this.connectHover()
        },
        onRemoved: function() {
            null != this._hoverConnection && (this._hoverConnection.dispose(), this._hoverConnection = null)
        },
        onUpdate: function(a) {
            this.x.update(a);
            this.y.update(a);
            this.rotation.update(a);
            this.scaleX.update(a);
            this.scaleY.update(a);
            this.alpha.update(a);
            this.anchorX.update(a);
            this.anchorY.update(a)
        },
        draw: function() {},
        getParentSprite: function() {
            if (null == this.owner) return null;
            for (var a = this.owner.parent; null != a;) {
                var b = a._compMap.Sprite_0;
                if (null != b) return b;
                a = a.parent
            }
            return null
        },
        get_pointerDown: function() {
            null == this._pointerDown && (this._pointerDown = new A);
            return this._pointerDown
        },
        get_pointerUp: function() {
            null == this._pointerUp && (this._pointerUp = new A);
            return this._pointerUp
        },
        connectHover: function() {
            var a = this;
            null == this._hoverConnection && (this._hoverConnection = l._platform.getPointer().move.connect(function(b) {
                for (var c = b.hit; null != c;) {
                    if (c == a) return;
                    c = c.getParentSprite()
                }
                null != a._pointerOut && 0 != (a._flags & 256) && a._pointerOut.emit(b);
                a._flags &= -257;
                a._hoverConnection.dispose();
                a._hoverConnection = null
            }))
        },
        set_visible: function(a) {
            this._flags = ac.set(this._flags, 1, a);
            return a
        },
        onPointerDown: function(a) {
            this.onHover(a);
            null != this._pointerDown && this._pointerDown.emit(a)
        },
        onPointerMove: function(a) {
            this.onHover(a);
            null != this._pointerMove && this._pointerMove.emit(a)
        },
        onHover: function(a) {
            if (0 == (this._flags & 256) && (this._flags |= 256, null != this._pointerIn || null != this._pointerOut)) null != this._pointerIn && this._pointerIn.emit(a),
            this.connectHover()
        },
        onPointerUp: function(a) {
            switch (a.source[1]) {
            case 1:
                null != this._pointerOut && 0 != (this._flags & 256) && this._pointerOut.emit(a),
                this._flags &= -257,
                null != this._hoverConnection && (this._hoverConnection.dispose(), this._hoverConnection = null)
            }
            null != this._pointerUp && this._pointerUp.emit(a)
        },
        __class__: r,
        __properties__: v(C.prototype.__properties__, {
            set_visible: "set_visible",
            get_pointerUp: "get_pointerUp",
            get_pointerDown: "get_pointerDown"
        })
    });
    var fb = function(a, b, c) {
        r.call(this);
        this.color = a;
        this.width = new B(b);
        this.height = new B(c)
    };
    f["flambe.display.FillSprite"] = fb;
    fb.__name__ = ["flambe", "display", "FillSprite"];
    fb.__super__ = r;
    fb.prototype = v(r.prototype, {
        draw: function(a) {
            a.fillRect(this.color, 0, 0, this.width._value, this.height._value)
        },
        getNaturalWidth: function() {
            return this.width._value
        },
        getNaturalHeight: function() {
            return this.height._value
        },
        setSize: function(a, b) {
            this.width.set__(a);
            this.height.set__(b);
            return this
        },
        onUpdate: function(a) {
            r.prototype.onUpdate.call(this, a);
            this.width.update(a);
            this.height.update(a)
        },
        __class__: fb
    });
    var gb = function(a) {
        this._kernings = null;
        this.xOffset = this.yOffset = this.xAdvance = 0;
        this.page = null;
        this.x = this.y = this.width = this.height = 0;
        this.charCode = a
    };
    f["flambe.display.Glyph"] = gb;
    gb.__name__ = ["flambe", "display", "Glyph"];
    gb.prototype = {
        draw: function(a, b, c) {
            0 < this.width && a.drawSubTexture(this.page, b + this.xOffset, c + this.yOffset, this.x, this.y, this.width, this.height)
        },
        getKerning: function(a) {
            return null != this._kernings ? y["int"](this._kernings.get(a)) : 0
        },
        setKerning: function(a, b) {
            null == this._kernings && (this._kernings = new aa);
            this._kernings.set(a, b)
        },
        __class__: gb
    };
    var Ba = function(a, b) {
        this.name = b;
        this._pack = a;
        this.reload()
    };
    f["flambe.display.Font"] = Ba;
    Ba.__name__ = ["flambe", "display", "Font"];
    Ba.prototype = {
        layoutText: function(a, b, c, d, g) {
            null == g && (g = 0);
            null == d && (d = 0);
            null == c && (c = 0);
            null == b && (b = T.Left);
            return new ta(this, a, b, c, d, g)
        },
        reload: function() {
            this._glyphs = new aa;
            this._glyphs.set(Ba.NEWLINE.charCode, Ba.NEWLINE);
            for (var a = new Ca(this._pack.getFile(this.name + ".fnt").toString()), b = new aa, c = this.name.lastIndexOf("/"), c = 0 <= c ? t.substr(this.name, 0, c + 1) : "", d = a.keywords(); d.hasNext();) switch (d.next()) {
            case "info":
                for (var g = a.pairs(); g.hasNext();) {
                    var j = g.next();
                    switch (j.key) {
                    case "size":
                        this.size = j.getInt()
                    }
                }
                break;
            case "common":
                for (g = a.pairs(); g.hasNext();) switch (j = g.next(), j.key) {
                case "lineHeight":
                    this.lineHeight = j.getInt()
                }
                break;
            case "page":
                for (var g = 0,
                j = null,
                e = a.pairs(); e.hasNext();) {
                    var f = e.next();
                    switch (f.key) {
                    case "id":
                        g = f.getInt();
                        break;
                    case "file":
                        j = f.getString()
                    }
                }
                j = this._pack.getTexture(c + L.removeFileExtension(j));
                b.set(g, j);
                break;
            case "char":
                g = null;
                for (j = a.pairs(); j.hasNext();) switch (e = j.next(), e.key) {
                case "id":
                    g = new gb(e.getInt());
                    break;
                case "x":
                    g.x = e.getInt();
                    break;
                case "y":
                    g.y = e.getInt();
                    break;
                case "width":
                    g.width = e.getInt();
                    break;
                case "height":
                    g.height = e.getInt();
                    break;
                case "page":
                    e = e.getInt();
                    g.page = b.get(e);
                    break;
                case "xoffset":
                    g.xOffset = e.getInt();
                    break;
                case "yoffset":
                    g.yOffset = e.getInt();
                    break;
                case "xadvance":
                    g.xAdvance = e.getInt()
                }
                this._glyphs.set(g.charCode, g);
                break;
            case "kerning":
                g = null;
                e = j = 0;
                for (f = a.pairs(); f.hasNext();) {
                    var k = f.next();
                    switch (k.key) {
                    case "first":
                        g = this._glyphs.get(k.getInt());
                        break;
                    case "second":
                        j = k.getInt();
                        break;
                    case "amount":
                        e = k.getInt()
                    }
                }
                null != g && 0 != e && g.setKerning(j, e)
            }
        },
        __class__: Ba
    };
    var T = f["flambe.display.TextAlign"] = {
        __ename__: ["flambe", "display", "TextAlign"],
        __constructs__: ["Left", "Center", "Right"]
    };
    T.Left = ["Left", 0];
    T.Left.toString = q;
    T.Left.__enum__ = T;
    T.Center = ["Center", 1];
    T.Center.toString = q;
    T.Center.__enum__ = T;
    T.Right = ["Right", 2];
    T.Right.toString = q;
    T.Right.__enum__ = T;
    var ta = function(a, b, c, d, g, j) {
        this.lines = 0;
        var e = this;
        this._font = a;
        this._glyphs = [];
        this._offsets = [];
        this._lineOffset = Math.round(a.lineHeight + j);
        this.bounds = new La;
        for (var f = [], j = b.length, k = 0; k < j;) {
            var h = k++,
            h = b.charCodeAt(h),
            h = a._glyphs.get(h);
            null != h ? this._glyphs.push(h) : null
        }
        for (var b = -1,
        i = 0,
        l = 0,
        a = a._glyphs.get(10), j = function() {
            e.bounds.width = hb.max(e.bounds.width, i);
            e.bounds.height += l;
            f[e.lines] = i;
            l = i = 0; ++e.lines
        },
        k = 0; k < this._glyphs.length;) {
            h = this._glyphs[k];
            this._offsets[k] = Math.round(i);
            var m = 0 < d && i + h.width > d;
            m || h == a ? (m && (0 <= b ? (this._glyphs[b] = a, i = this._offsets[b], k = b) : this._glyphs.splice(k, 0, a)), b = -1, l = this._lineOffset, j()) : (32 == h.charCode && (b = k), i += h.xAdvance + g, l = hb.max(l, h.height + h.yOffset), k + 1 < this._glyphs.length && (i += h.getKerning(this._glyphs[k + 1].charCode))); ++k
        }
        j();
        g = 0;
        a = ta.getAlignOffset(c, f[0], d);
        b = 1.79769313486231E308;
        j = -1.79769313486231E308;
        h = k = 0;
        for (m = this._glyphs.length; h < m;) {
            var o = this._glyphs[h];
            10 == o.charCode && (g += this._lineOffset, ++k, a = ta.getAlignOffset(c, f[k], d));
            this._offsets[h] += a;
            var n = g + o.yOffset;
            b < n || (b = n);
            j = hb.max(j, n + o.height); ++h
        }
        this.bounds.x = ta.getAlignOffset(c, this.bounds.width, d);
        this.bounds.y = b;
        this.bounds.height = j - b
    };
    f["flambe.display.TextLayout"] = ta;
    ta.__name__ = ["flambe", "display", "TextLayout"];
    ta.getAlignOffset = function(a, b, c) {
        switch (a[1]) {
        case 0:
            return 0;
        case 2:
            return c - b;
        case 1:
            return Math.round((c - b) / 2)
        }
    };
    ta.prototype = {
        draw: function(a) {
            for (var b = 0,
            c = 0,
            d = this._glyphs.length; c < d;) {
                var g = this._glyphs[c];
                10 == g.charCode ? b += this._lineOffset: g.draw(a, this._offsets[c], b); ++c
            }
        },
        __class__: ta
    };
    var Ca = function(a) {
        this._configText = a;
        this._keywordPattern = new W("([A-Za-z]+)(.*)", "");
        this._pairPattern = new W('([A-Za-z]+)=("[^"]*"|[^\\s]+)', "")
    };
    f["flambe.display._Font.ConfigParser"] = Ca;
    Ca.__name__ = ["flambe", "display", "_Font", "ConfigParser"];
    Ca.advance = function(a, b) {
        var c = b.matchedPos();
        return t.substr(a, c.pos + c.len, a.length)
    };
    Ca.prototype = {
        keywords: function() {
            var a = this,
            b = this._configText;
            return {
                next: function() {
                    b = Ca.advance(b, a._keywordPattern);
                    a._pairText = a._keywordPattern.matched(2);
                    return a._keywordPattern.matched(1)
                },
                hasNext: function() {
                    return a._keywordPattern.match(b)
                }
            }
        },
        pairs: function() {
            var a = this,
            b = this._pairText;
            return {
                next: function() {
                    b = Ca.advance(b, a._pairPattern);
                    return new Ib(a._pairPattern.matched(1), a._pairPattern.matched(2))
                },
                hasNext: function() {
                    return a._pairPattern.match(b)
                }
            }
        },
        __class__: Ca
    };
    var Ib = function(a, b) {
        this.key = a;
        this._value = b
    };
    f["flambe.display._Font.ConfigPair"] = Ib;
    Ib.__name__ = ["flambe", "display", "_Font", "ConfigPair"];
    Ib.prototype = {
        getInt: function() {
            return y.parseInt(this._value)
        },
        getString: function() {
            return 34 != this._value.charCodeAt(0) ? null: t.substr(this._value, 1, this._value.length - 2)
        },
        __class__: Ib
    };
    var Jb = function() {};
    f["flambe.display.Graphics"] = Jb;
    Jb.__name__ = ["flambe", "display", "Graphics"];
    Jb.prototype = {
        __class__: Jb
    };
    var ib = function(a) {
        r.call(this);
        this.texture = a
    };
    f["flambe.display.ImageSprite"] = ib;
    ib.__name__ = ["flambe", "display", "ImageSprite"];
    ib.__super__ = r;
    ib.prototype = v(r.prototype, {
        draw: function(a) {
            null != this.texture && a.drawTexture(this.texture, 0, 0)
        },
        getNaturalWidth: function() {
            return null != this.texture ? this.texture.get_width() : 0
        },
        getNaturalHeight: function() {
            return null != this.texture ? this.texture.get_height() : 0
        },
        __class__: ib
    });
    var ea = f["flambe.display.Orientation"] = {
        __ename__: ["flambe", "display", "Orientation"],
        __constructs__: ["Portrait", "Landscape"]
    };
    ea.Portrait = ["Portrait", 0];
    ea.Portrait.toString = q;
    ea.Portrait.__enum__ = ea;
    ea.Landscape = ["Landscape", 1];
    ea.Landscape.toString = q;
    ea.Landscape.__enum__ = ea;
    var jb = function() {};
    f["flambe.display.Texture"] = jb;
    jb.__name__ = ["flambe", "display", "Texture"];
    jb.__interfaces__ = [sa];
    jb.prototype = {
        __class__: jb
    };
    var bc = function() {};
    f["flambe.display.SubTexture"] = bc;
    bc.__name__ = ["flambe", "display", "SubTexture"];
    bc.__interfaces__ = [jb];
    var kb = function(a, b) {
        null == b && (b = "");
        this._layout = null;
        var c = this;
        r.call(this);
        this._font = a;
        this._text = b;
        this._align = T.Left;
        this._flags |= 64;
        var d = function() {
            c._flags |= 64
        };
        this.wrapWidth = new B(0, d);
        this.letterSpacing = new B(0, d);
        this.lineSpacing = new B(0, d)
    };
    f["flambe.display.TextSprite"] = kb;
    kb.__name__ = ["flambe", "display", "TextSprite"];
    kb.__super__ = r;
    kb.prototype = v(r.prototype, {
        draw: function(a) {
            this.updateLayout();
            this._layout.draw(a)
        },
        getNaturalWidth: function() {
            this.updateLayout();
            return 0 < this.wrapWidth._value ? this.wrapWidth._value: this._layout.bounds.width
        },
        getNaturalHeight: function() {
            this.updateLayout();
            var a = this._layout.lines * (this._font.lineHeight + this.lineSpacing._value),
            b = this._layout.bounds.height;
            return a > b ? a: b
        },
        containsLocal: function(a, b) {
            this.updateLayout();
            return this._layout.bounds.contains(a, b)
        },
        setAlign: function(a) {
            this.set_align(a);
            return this
        },
        set_text: function(a) {
            a != this._text && (this._text = a, this._flags |= 64);
            return a
        },
        set_align: function(a) {
            a != this._align && (this._align = a, this._flags |= 64);
            return a
        },
        updateLayout: function() {
            0 != (this._flags & 64) && (this._flags &= -65, this._layout = this._font.layoutText(this._text, this._align, this.wrapWidth._value, this.letterSpacing._value, this.lineSpacing._value))
        },
        onUpdate: function(a) {
            r.prototype.onUpdate.call(this, a);
            this.wrapWidth.update(a);
            this.letterSpacing.update(a);
            this.lineSpacing.update(a)
        },
        __class__: kb,
        __properties__: v(r.prototype.__properties__, {
            set_align: "set_align",
            set_text: "set_text"
        })
    });
    var J = f["flambe.input.MouseButton"] = {
        __ename__: ["flambe", "input", "MouseButton"],
        __constructs__: ["Left", "Middle", "Right", "Unknown"]
    };
    J.Left = ["Left", 0];
    J.Left.toString = q;
    J.Left.__enum__ = J;
    J.Middle = ["Middle", 1];
    J.Middle.toString = q;
    J.Middle.__enum__ = J;
    J.Right = ["Right", 2];
    J.Right.toString = q;
    J.Right.__enum__ = J;
    J.Unknown = function(a) {
        a = ["Unknown", 3, a];
        a.__enum__ = J;
        a.toString = q;
        return a
    };
    var ba = f["flambe.input.MouseCursor"] = {
        __ename__: ["flambe", "input", "MouseCursor"],
        __constructs__: ["Default", "Button", "None"]
    };
    ba.Default = ["Default", 0];
    ba.Default.toString = q;
    ba.Default.__enum__ = ba;
    ba.Button = ["Button", 1];
    ba.Button.toString = q;
    ba.Button.__enum__ = ba;
    ba.None = ["None", 2];
    ba.None.toString = q;
    ba.None.__enum__ = ba;
    var Kb = function() {
        this.init(0, 0, 0, null)
    };
    f["flambe.input.MouseEvent"] = Kb;
    Kb.__name__ = ["flambe", "input", "MouseEvent"];
    Kb.prototype = {
        init: function(a, b, c, d) {
            this.id = a;
            this.viewX = b;
            this.viewY = c;
            this.button = d
        },
        __class__: Kb
    };
    var lb = f["flambe.input.EventSource"] = {
        __ename__: ["flambe", "input", "EventSource"],
        __constructs__: ["Mouse", "Touch"]
    };
    lb.Mouse = function(a) {
        a = ["Mouse", 0, a];
        a.__enum__ = lb;
        a.toString = q;
        return a
    };
    lb.Touch = function(a) {
        a = ["Touch", 1, a];
        a.__enum__ = lb;
        a.toString = q;
        return a
    };
    var Lb = function() {
        this.init(0, 0, 0, null, null)
    };
    f["flambe.input.PointerEvent"] = Lb;
    Lb.__name__ = ["flambe", "input", "PointerEvent"];
    Lb.prototype = {
        init: function(a, b, c, d, g) {
            this.id = a;
            this.viewX = b;
            this.viewY = c;
            this.hit = d;
            this.source = g;
            this._stopped = !1
        },
        __class__: Lb
    };
    var Mb = function(a) {
        this.id = a;
        this._source = lb.Touch(this)
    };
    f["flambe.input.TouchPoint"] = Mb;
    Mb.__name__ = ["flambe", "input", "TouchPoint"];
    Mb.prototype = {
        init: function(a, b) {
            this.viewX = a;
            this.viewY = b
        },
        __class__: Mb
    };
    var hb = function() {};
    f["flambe.math.FMath"] = hb;
    hb.__name__ = ["flambe", "math", "FMath"];
    hb.max = function(a, b) {
        return a > b ? a: b
    };
    var Hb = function() {
        this.identity()
    };
    f["flambe.math.Matrix"] = Hb;
    Hb.__name__ = ["flambe", "math", "Matrix"];
    Hb.prototype = {
        set: function(a, b, c, d, g, j) {
            this.m00 = a;
            this.m01 = c;
            this.m02 = g;
            this.m10 = b;
            this.m11 = d;
            this.m12 = j
        },
        identity: function() {
            this.set(1, 0, 0, 1, 0, 0)
        },
        compose: function(a, b, c, d, g) {
            var j = Math.sin(g),
            g = Math.cos(g);
            this.set(g * c, j * c, -j * d, g * d, a, b)
        },
        translate: function(a, b) {
            this.m02 += this.m00 * a + this.m01 * b;
            this.m12 += this.m11 * b + this.m10 * a
        },
        determinant: function() {
            return this.m00 * this.m11 - this.m01 * this.m10
        },
        inverseTransform: function(a, b, c) {
            var d = this.determinant();
            if (0 == d) return ! 1;
            a -= this.m02;
            b -= this.m12;
            c.x = (a * this.m11 - b * this.m01) / d;
            c.y = (b * this.m00 - a * this.m10) / d;
            return ! 0
        },
        __class__: Hb
    };
    var La = function(a, b, c, d) {
        null == d && (d = 0);
        null == c && (c = 0);
        null == b && (b = 0);
        null == a && (a = 0);
        this.set(a, b, c, d)
    };
    f["flambe.math.Rectangle"] = La;
    La.__name__ = ["flambe", "math", "Rectangle"];
    La.prototype = {
        set: function(a, b, c, d) {
            this.x = a;
            this.y = b;
            this.width = c;
            this.height = d
        },
        contains: function(a, b) {
            a -= this.x;
            if (0 <= this.width) {
                if (0 > a || a > this.width) return ! 1
            } else if (0 < a || a < this.width) return ! 1;
            b -= this.y;
            if (0 <= this.height) {
                if (0 > b || b > this.height) return ! 1
            } else if (0 < b || b < this.height) return ! 1;
            return ! 0
        },
        __class__: La
    };
    var M = function() {
        this._disposed = !1
    };
    f["flambe.platform.BasicAsset"] = M;
    M.__name__ = ["flambe", "platform", "BasicAsset"];
    M.__interfaces__ = [sa];
    M.prototype = {
        dispose: function() {
            this._disposed || (this._disposed = !0, this.onDisposed())
        },
        onDisposed: function() {
            null
        },
        __class__: M
    };
    var ua = function(a, b) {
        var c = this;
        this.manifest = b;
        this._platform = a;
        this.promise = new mb;
        this._bytesLoaded = new N;
        this._pack = new nb(b, this);
        var d = ma.array(b);
        if (0 == d.length) this.handleSuccess();
        else {
            for (var g = new N,
            j = 0; j < d.length;) {
                var e = d[j]; ++j;
                var f = g.get(e.name);
                null == f && (f = [], g.set(e.name, f));
                f.push(e)
            }
            this._assetsRemaining = ma.count(g);
            for (d = g.iterator(); d.hasNext();) g = [d.next()],
            this.pickBestEntry(g[0],
            function(a) {
                return function(d) {
                    if (null != d) {
                        var g = b.getFullURL(d);
                        try {
                            c.loadEntry(g, d)
                        } catch(j) {
                            c.handleError(d, "Unexpected error: " + y.string(j))
                        }
                        g = c.promise;
                        g.set_total(g._total + d.bytes)
                    } else d = a[0][0],
                    ua.isAudio(d.format) ? c.handleLoad(d, Z.getInstance()) : c.handleError(d, "Could not find a supported format to load")
                }
            } (g))
        }
    };
    f["flambe.platform.BasicAssetPackLoader"] = ua;
    ua.__name__ = ["flambe", "platform", "BasicAssetPackLoader"];
    ua.isAudio = function(a) {
        switch (a[1]) {
        case 8:
        case 9:
        case 10:
        case 11:
        case 12:
            return ! 0;
        default:
            return ! 1
        }
    };
    ua.prototype = {
        onDisposed: function() {},
        pickBestEntry: function(a, b) {
            this.getAssetFormats(function(c) {
                for (var d = 0; d < c.length;) {
                    var g = c[d]; ++d;
                    for (var j = 0; j < a.length;) {
                        var e = a[j]; ++j;
                        if (e.format == g) {
                            b(e);
                            return
                        }
                    }
                }
                b(null)
            })
        },
        loadEntry: function() {
            null
        },
        getAssetFormats: function() {
            null
        },
        handleLoad: function(a, b) {
            if (!this._pack.disposed) {
                this.handleProgress(a, a.bytes);
                var c;
                switch (a.format[1]) {
                case 0:
                case 1:
                case 2:
                case 3:
                case 4:
                case 5:
                case 6:
                case 7:
                    c = this._pack.textures;
                    break;
                case 8:
                case 9:
                case 10:
                case 11:
                case 12:
                    c = this._pack.sounds;
                    break;
                case 13:
                    c = this._pack.files
                }
                c.set(a.name, b);
                this._assetsRemaining -= 1;
                0 == this._assetsRemaining && this.handleSuccess()
            }
        },
        handleProgress: function(a, b) {
            this._bytesLoaded.set(a.name, b);
            for (var c = 0,
            d = this._bytesLoaded.iterator(); d.hasNext();) var g = d.next(),
            c = c + g;
            this.promise.set_progress(c)
        },
        handleSuccess: function() {
            this.promise.set_result(this._pack)
        },
        handleError: function(a, b) {
            this.promise.error.emit(L.withFields(b, ["url", a.url]))
        },
        handleTextureError: function(a) {
            this.handleError(a, "Failed to create texture. Is the GPU context unavailable?")
        },
        __class__: ua
    };
    var nb = function(a, b) {
        this.disposed = !1;
        this._manifest = a;
        this.loader = b;
        this.textures = new N;
        this.sounds = new N;
        this.files = new N
    };
    f["flambe.platform._BasicAssetPackLoader.BasicAssetPack"] = nb;
    nb.__name__ = ["flambe", "platform", "_BasicAssetPackLoader", "BasicAssetPack"];
    nb.__interfaces__ = [db];
    nb.prototype = {
        getTexture: function(a, b) {
            null == b && (b = !0);
            var c = this.textures.get(a);
            if (null == c && b) throw L.withFields("Missing texture", ["name", a]);
            return c
        },
        getSound: function(a, b) {
            null == b && (b = !0);
            var c = this.sounds.get(a);
            if (null == c && b) throw L.withFields("Missing sound", ["name", a]);
            return c
        },
        getFile: function(a, b) {
            null == b && (b = !0);
            var c = this.files.get(a);
            if (null == c && b) throw L.withFields("Missing file", ["name", a]);
            return c
        },
        dispose: function() {
            if (!this.disposed) {
                this.disposed = !0;
                for (var a = this.textures.iterator(); a.hasNext();) a.next().dispose();
                this.textures = null;
                for (a = this.sounds.iterator(); a.hasNext();) a.next().dispose();
                this.sounds = null;
                for (a = this.files.iterator(); a.hasNext();) a.next().dispose();
                this.files = null;
                this.loader.onDisposed()
            }
        },
        __class__: nb
    };
    var Ma = function(a) {
        this._disposed = !1;
        this._content = a
    };
    f["flambe.platform.BasicFile"] = Ma;
    Ma.__name__ = ["flambe", "platform", "BasicFile"];
    Ma.__interfaces__ = [eb];
    Ma.__super__ = M;
    Ma.prototype = v(M.prototype, {
        toString: function() {
            return this._content
        },
        onDisposed: function() {
            this._content = null
        },
        __class__: Ma
    });
    var ec = function() {};
    f["flambe.subsystem.MouseSystem"] = ec;
    ec.__name__ = ["flambe", "subsystem", "MouseSystem"];
    var U = function(a) {
        this._pointer = a;
        this._source = lb.Mouse(U._sharedEvent);
        this.down = new A;
        this.move = new A;
        this.up = new A;
        this.scroll = new A;
        this._y = this._x = 0;
        this._cursor = ba.Default;
        this._buttonStates = new aa
    };
    f["flambe.platform.BasicMouse"] = U;
    U.__name__ = ["flambe", "platform", "BasicMouse"];
    U.__interfaces__ = [ec];
    U.prototype = {
        submitDown: function(a, b, c) {
            this._buttonStates.exists(c) || (this._buttonStates.set(c, !0), this.prepare(a, b, Nb.toButton(c)), this._pointer.submitDown(a, b, this._source), this.down.emit(U._sharedEvent))
        },
        submitMove: function(a, b) {
            this.prepare(a, b, null);
            this._pointer.submitMove(a, b, this._source);
            this.move.emit(U._sharedEvent)
        },
        submitUp: function(a, b, c) {
            this._buttonStates.exists(c) && (this._buttonStates.remove(c), this.prepare(a, b, Nb.toButton(c)), this._pointer.submitUp(a, b, this._source), this.up.emit(U._sharedEvent))
        },
        submitScroll: function(a, b, c) {
            this._x = a;
            this._y = b;
            if (null == this.scroll._head) return ! 1;
            this.scroll.emit(c);
            return ! 0
        },
        prepare: function(a, b, c) {
            this._x = a;
            this._y = b;
            U._sharedEvent.init(U._sharedEvent.id + 1, a, b, c)
        },
        __class__: U
    };
    var Ob = function() {};
    f["flambe.subsystem.PointerSystem"] = Ob;
    Ob.__name__ = ["flambe", "subsystem", "PointerSystem"];
    Ob.prototype = {
        __class__: Ob
    };
    var I = function(a, b, c) {
        null == c && (c = !1);
        null == b && (b = 0);
        null == a && (a = 0);
        this.down = new A;
        this.move = new A;
        this.up = new A;
        this._x = a;
        this._y = b;
        this._isDown = c
    };
    f["flambe.platform.BasicPointer"] = I;
    I.__name__ = ["flambe", "platform", "BasicPointer"];
    I.__interfaces__ = [Ob];
    I.prototype = {
        submitDown: function(a, b, c) {
            if (!this._isDown) {
                this.submitMove(a, b, c);
                this._isDown = !0;
                var d = [],
                g = r.hitTest(l.root, a, b);
                if (null != g) {
                    var e = g.owner;
                    do {
                        var f = e._compMap.Sprite_0;
                        null != f && d.push(f);
                        e = e.parent
                    } while ( null != e )
                }
                this.prepare(a, b, g, c);
                for (a = 0; a < d.length;) if (b = d[a], ++a, b.onPointerDown(I._sharedEvent), I._sharedEvent._stopped) return;
                this.down.emit(I._sharedEvent)
            }
        },
        submitMove: function(a, b, c) {
            if (! (a == this._x && b == this._y)) {
                var d = [],
                g = r.hitTest(l.root, a, b);
                if (null != g) {
                    var e = g.owner;
                    do {
                        var f = e._compMap.Sprite_0;
                        null != f && d.push(f);
                        e = e.parent
                    } while ( null != e )
                }
                this.prepare(a, b, g, c);
                for (a = 0; a < d.length;) if (b = d[a], ++a, b.onPointerMove(I._sharedEvent), I._sharedEvent._stopped) return;
                this.move.emit(I._sharedEvent)
            }
        },
        submitUp: function(a, b, c) {
            if (this._isDown) {
                this.submitMove(a, b, c);
                this._isDown = !1;
                var d = [],
                g = r.hitTest(l.root, a, b);
                if (null != g) {
                    var e = g.owner;
                    do {
                        var f = e._compMap.Sprite_0;
                        null != f && d.push(f);
                        e = e.parent
                    } while ( null != e )
                }
                this.prepare(a, b, g, c);
                for (a = 0; a < d.length;) if (b = d[a], ++a, b.onPointerUp(I._sharedEvent), I._sharedEvent._stopped) return;
                this.up.emit(I._sharedEvent)
            }
        },
        prepare: function(a, b, c, d) {
            this._x = a;
            this._y = b;
            I._sharedEvent.init(I._sharedEvent.id + 1, a, b, c, d)
        },
        __class__: I
    };
    var va = function(a, b, c) {
        this._parent = null;
        this.rootX = this.rootY = 0;
        this._disposed = !1;
        this.root = a;
        this._width = b;
        this._height = c
    };
    f["flambe.platform.BasicTexture"] = va;
    va.__name__ = ["flambe", "platform", "BasicTexture"];
    va.__interfaces__ = [bc];
    va.__super__ = M;
    va.prototype = v(M.prototype, {
        onDisposed: function() {
            null == this._parent && this.root.dispose()
        },
        get_width: function() {
            return this._width
        },
        get_height: function() {
            return this._height
        },
        __class__: va,
        __properties__: {
            get_height: "get_height",
            get_width: "get_width"
        }
    });
    var cc = function() {};
    f["flambe.subsystem.TouchSystem"] = cc;
    cc.__name__ = ["flambe", "subsystem", "TouchSystem"];
    var Za = function(a, b) {
        null == b && (b = 4);
        this._pointer = a;
        this._maxPoints = b;
        this._pointMap = new aa;
        this._points = [];
        this.down = new A;
        this.move = new A;
        this.up = new A
    };
    f["flambe.platform.BasicTouch"] = Za;
    Za.__name__ = ["flambe", "platform", "BasicTouch"];
    Za.__interfaces__ = [cc];
    Za.prototype = {
        submitDown: function(a, b, c) {
            if (!this._pointMap.exists(a)) {
                var d = new Mb(a);
                d.init(b, c);
                this._pointMap.set(a, d);
                this._points.push(d);
                null == this._pointerTouch && (this._pointerTouch = d, this._pointer.submitDown(b, c, d._source));
                this.down.emit(d)
            }
        },
        submitMove: function(a, b, c) {
            a = this._pointMap.get(a);
            null != a && (a.init(b, c), this._pointerTouch == a && this._pointer.submitMove(b, c, a._source), this.move.emit(a))
        },
        submitUp: function(a, b, c) {
            var d = this._pointMap.get(a);
            null != d && (d.init(b, c), this._pointMap.remove(a), t.remove(this._points, d), this._pointerTouch == d && (this._pointerTouch = null, this._pointer.submitUp(b, c, d._source)), this.up.emit(d))
        },
        __class__: Za
    };
    var Da = function() {};
    f["flambe.sound.Sound"] = Da;
    Da.__name__ = ["flambe", "sound", "Sound"];
    Da.__interfaces__ = [sa];
    Da.prototype = {
        __class__: Da
    };
    var Z = function() {
        this._disposed = !1;
        this._playback = new ob(this)
    };
    f["flambe.platform.DummySound"] = Z;
    Z.__name__ = ["flambe", "platform", "DummySound"];
    Z.__interfaces__ = [Da];
    Z.getInstance = function() {
        null == Z._instance && (Z._instance = new Z);
        return Z._instance
    };
    Z.__super__ = M;
    Z.prototype = v(M.prototype, {
        play: function() {
            return this._playback
        },
        loop: function() {
            return this._playback
        },
        onDisposed: function() {},
        __class__: Z
    });
    var Ea = function() {};
    f["flambe.sound.Playback"] = Ea;
    Ea.__name__ = ["flambe", "sound", "Playback"];
    Ea.__interfaces__ = [da];
    Ea.prototype = {
        __class__: Ea
    };
    var ob = function(a) {
        this._sound = a;
        this.volume = new B(0);
        this._complete = new K(!0)
    };
    f["flambe.platform.DummyPlayback"] = ob;
    ob.__name__ = ["flambe", "platform", "DummyPlayback"];
    ob.__interfaces__ = [Ea];
    ob.prototype = {
        get_sound: function() {
            return this._sound
        },
        set_paused: function() {
            return ! 0
        },
        dispose: function() {},
        __class__: ob,
        __properties__: {
            get_sound: "get_sound",
            set_paused: "set_paused"
        }
    };
    var pb = function() {};
    f["flambe.subsystem.StorageSystem"] = pb;
    pb.__name__ = ["flambe", "subsystem", "StorageSystem"];
    pb.prototype = {
        __class__: pb
    };
    var bb = function() {
        this.clear()
    };
    f["flambe.platform.DummyStorage"] = bb;
    bb.__name__ = ["flambe", "platform", "DummyStorage"];
    bb.__interfaces__ = [pb];
    bb.prototype = {
        set: function(a, b) {
            this._hash.set(a, b);
            return ! 0
        },
        get: function(a, b) {
            return this._hash.exists(a) ? this._hash.get(a) : b
        },
        clear: function() {
            this._hash = new N
        },
        __class__: bb
    };
    var $a = function() {
        this.down = new A;
        this.move = new A;
        this.up = new A
    };
    f["flambe.platform.DummyTouch"] = $a;
    $a.__name__ = ["flambe", "platform", "DummyTouch"];
    $a.__interfaces__ = [cc];
    $a.prototype = {
        __class__: $a
    };
    var Na = function() {
        this._entries = []
    };
    f["flambe.platform.EventGroup"] = Na;
    Na.__name__ = ["flambe", "platform", "EventGroup"];
    Na.__interfaces__ = [da];
    Na.prototype = {
        addListener: function(a, b, c) {
            a.addEventListener(b, c, !1);
            this._entries.push(new Pb(a, b, c))
        },
        addDisposingListener: function(a, b, c) {
            var d = this;
            this.addListener(a, b,
            function(a) {
                d.dispose();
                c(a)
            })
        },
        dispose: function() {
            for (var a = 0,
            b = this._entries; a < b.length;) {
                var c = b[a]; ++a;
                c.dispatcher.removeEventListener(c.type, c.listener, !1)
            }
            this._entries = []
        },
        __class__: Na
    };
    var Pb = function(a, b, c) {
        this.dispatcher = a;
        this.type = b;
        this.listener = c
    };
    f["flambe.platform._EventGroup.Entry"] = Pb;
    Pb.__name__ = ["flambe", "platform", "_EventGroup", "Entry"];
    Pb.prototype = {
        __class__: Pb
    };
    var qb = function() {};
    f["flambe.platform.InternalGraphics"] = qb;
    qb.__name__ = ["flambe", "platform", "InternalGraphics"];
    qb.__interfaces__ = [Jb];
    qb.prototype = {
        __class__: qb
    };
    var Qb = function() {};
    f["flambe.subsystem.RendererSystem"] = Qb;
    Qb.__name__ = ["flambe", "subsystem", "RendererSystem"];
    Qb.prototype = {
        __class__: Qb
    };
    var rb = function() {};
    f["flambe.platform.InternalRenderer"] = rb;
    rb.__name__ = ["flambe", "platform", "InternalRenderer"];
    rb.__interfaces__ = [Qb];
    rb.prototype = {
        __class__: rb
    };
    var ya = function() {
        this._tickables = []
    };
    f["flambe.platform.MainLoop"] = ya;
    ya.__name__ = ["flambe", "platform", "MainLoop"];
    ya.updateEntity = function(a, b) {
        var c = a._compMap.SpeedAdjuster_6;
        if (null != c && (c._realDt = b, b *= c.scale._value, 0 >= b)) {
            c.onUpdate(b);
            return
        }
        for (c = a.firstComponent; null != c;) {
            var d = c.next;
            c.onUpdate(b);
            c = d
        }
        for (c = a.firstChild; null != c;) d = c.next,
        ya.updateEntity(c, b),
        c = d
    };
    ya.prototype = {
        update: function(a) {
            if (! (0 >= a)) {
                1 < a && (a = 1);
                for (var b = 0; b < this._tickables.length;) {
                    var c = this._tickables[b];
                    null == c || c.update(a) ? this._tickables.splice(b, 1) : ++b
                }
                l.volume.update(a);
                ya.updateEntity(l.root, a)
            }
        },
        render: function(a) {
            var b = a.graphics;
            null != b && (a.willRender(), r.render(l.root, b), a.didRender())
        },
        addTickable: function(a) {
            this._tickables.push(a)
        },
        __class__: ya
    };
    var Nb = function() {};
    f["flambe.platform.MouseCodes"] = Nb;
    Nb.__name__ = ["flambe", "platform", "MouseCodes"];
    Nb.toButton = function(a) {
        switch (a) {
        case 0:
            return J.Left;
        case 1:
            return J.Middle;
        case 2:
            return J.Right
        }
        return J.Unknown(a)
    };
    var fc = function() {};
    f["flambe.platform.TextureRoot"] = fc;
    fc.__name__ = ["flambe", "platform", "TextureRoot"];
    var sb = function() {};
    f["flambe.platform.Tickable"] = sb;
    sb.__name__ = ["flambe", "platform", "Tickable"];
    sb.prototype = {
        __class__: sb
    };
    var tb = function(a) {
        this._firstDraw = !1;
        this._canvasCtx = a.getContext("2d")
    };
    f["flambe.platform.html.CanvasGraphics"] = tb;
    tb.__name__ = ["flambe", "platform", "html", "CanvasGraphics"];
    tb.__interfaces__ = [qb];
    tb.prototype = {
        save: function() {
            this._canvasCtx.save()
        },
        transform: function(a, b, c, d, g, e) {
            this._canvasCtx.transform(a, b, c, d, g, e)
        },
        restore: function() {
            this._canvasCtx.restore()
        },
        drawTexture: function(a, b, c) {
            this.drawSubTexture(a, b, c, 0, 0, a.get_width(), a.get_height())
        },
        drawSubTexture: function(a, b, c, d, g, e, f) {
            this._firstDraw ? (this._firstDraw = !1, this._canvasCtx.globalCompositeOperation = "copy", this.drawSubTexture(a, b, c, d, g, e, f), this._canvasCtx.globalCompositeOperation = "source-over") : this._canvasCtx.drawImage(a.root.image, a.rootX + d | 0, a.rootY + g | 0, e | 0, f | 0, b | 0, c | 0, e | 0, f | 0)
        },
        fillRect: function(a, b, c, d, g) {
            if (this._firstDraw) this._firstDraw = !1,
            this._canvasCtx.globalCompositeOperation = "copy",
            this.fillRect(a, b, c, d, g),
            this._canvasCtx.globalCompositeOperation = "source-over";
            else {
                for (a = (16777215 & a).toString(16); 6 > a.length;) a = "0" + y.string(a);
                this._canvasCtx.fillStyle = "#" + y.string(a);
                this._canvasCtx.fillRect(b | 0, c | 0, d | 0, g | 0)
            }
        },
        multiplyAlpha: function(a) {
            this._canvasCtx.globalAlpha *= a
        },
        setBlendMode: function(a) {
            var b;
            switch (a[1]) {
            case 0:
                b = "source-over";
                break;
            case 1:
                b = "lighter";
                break;
            case 2:
                b = "destination-in";
                break;
            case 3:
                b = "copy"
            }
            this._canvasCtx.globalCompositeOperation = b
        },
        applyScissor: function(a, b, c, d) {
            this._canvasCtx.beginPath();
            this._canvasCtx.rect(a | 0, b | 0, c | 0, d | 0);
            this._canvasCtx.clip()
        },
        willRender: function() {
            this._firstDraw = !0
        },
        didRender: function() {},
        __class__: tb
    };
    var za = function(a) {
        this.graphics = new tb(a);
        this._hasGPU = new K(!0)
    };
    f["flambe.platform.html.CanvasRenderer"] = za;
    za.__name__ = ["flambe", "platform", "html", "CanvasRenderer"];
    za.__interfaces__ = [rb];
    za.prototype = {
        get_type: function() {
            return ca.Canvas
        },
        createTextureFromImage: function(a) {
            a = new Oa(za.CANVAS_TEXTURES ? n.createCanvas(a) : a);
            return a.createTexture(a.width, a.height)
        },
        getCompressedTextureFormats: function() {
            return []
        },
        createCompressedTexture: function() {
            return null
        },
        willRender: function() {
            this.graphics.willRender()
        },
        didRender: function() {
            this.graphics.didRender()
        },
        __class__: za,
        __properties__: {
            get_type: "get_type"
        }
    };
    var ub = function(a, b, c) {
        va.call(this, a, b, c)
    };
    f["flambe.platform.html.CanvasTexture"] = ub;
    ub.__name__ = ["flambe", "platform", "html", "CanvasTexture"];
    ub.__super__ = va;
    ub.prototype = v(va.prototype, {
        __class__: ub
    });
    var Oa = function(a) {
        this._graphics = null;
        this._disposed = !1;
        this.image = a;
        this.width = a.width;
        this.height = a.height
    };
    f["flambe.platform.html.CanvasTextureRoot"] = Oa;
    Oa.__name__ = ["flambe", "platform", "html", "CanvasTextureRoot"];
    Oa.__interfaces__ = [fc];
    Oa.__super__ = M;
    Oa.prototype = v(M.prototype, {
        createTexture: function(a, b) {
            return new ub(this, a, b)
        },
        onDisposed: function() {
            this._graphics = this.image = null
        },
        __class__: Oa
    });
    var u = function(a, b) {
        ua.call(this, a, b)
    };
    f["flambe.platform.html.HtmlAssetPackLoader"] = u;
    u.__name__ = ["flambe", "platform", "html", "HtmlAssetPackLoader"];
    u.detectImageFormats = function(a) {
        var b = [h.PNG, h.JPG, h.GIF],
        c = 2,
        d;
        d = window.document.createElement("img");
        d.onload = d.onerror = function() {
            1 == d.width && b.unshift(h.WEBP); --c;
            0 == c && a(b)
        };
        d.src = "";
        var g;
        g = window.document.createElement("img");
        g.onload = g.onerror = function() {
            1 == g.width && b.unshift(h.JXR); --c;
            0 == c && a(b)
        };
        g.src = ""
    };
    u.detectAudioFormats = function() {
        var a;
        a = window.document.createElement("audio");
        if (null == a || null == fa(a, a.canPlayType)) return [];
        var b = new W("\\b(iPhone|iPod|iPad|Android|Windows Phone)\\b", ""),
        c = window.navigator.userAgent;
        if (!s.get_supported() && b.match(c)) return [];
        for (var b = [{
            format: h.M4A,
            mimeType: "audio/mp4; codecs=mp4a"
        },
        {
            format: h.MP3,
            mimeType: "audio/mpeg"
        },
        {
            format: h.OPUS,
            mimeType: "audio/ogg; codecs=opus"
        },
        {
            format: h.OGG,
            mimeType: "audio/ogg; codecs=vorbis"
        },
        {
            format: h.WAV,
            mimeType: "audio/wav"
        }], c = [], d = 0; d < b.length;) {
            var g = b[d]; ++d;
            var e = "";
            try {
                e = a.canPlayType(g.mimeType)
            } catch(f) {}
            "" != e && c.push(g.format)
        }
        return c
    };
    u.supportsBlob = function() {
        if (u._detectBlobSupport) {
            u._detectBlobSupport = !1;
            if ((new W("\\bSilk\\b", "")).match(window.navigator.userAgent) || null == window.Blob) return ! 1;
            var a = new XMLHttpRequest;
            a.open("GET", ".", !0);
            if ("" != a.responseType) return ! 1;
            a.responseType = "blob";
            if ("blob" != a.responseType) return ! 1;
            u._URL = n.loadExtension("URL").value
        }
        return null != u._URL && null != u._URL.createObjectURL
    };
    u.__super__ = ua;
    u.prototype = v(ua.prototype, {
        loadEntry: function(a, b) {
            var c = this;
            switch (b.format[1]) {
            case 0:
            case 1:
            case 2:
            case 3:
            case 4:
                var d;
                d = window.document.createElement("img");
                var g = new Na;
                g.addDisposingListener(d, "load",
                function() {
                    u.supportsBlob() && u._URL.revokeObjectURL(d.src);
                    var a = c._platform.getRenderer().createTextureFromImage(d);
                    null != a ? c.handleLoad(b, a) : c.handleTextureError(b)
                });
                g.addDisposingListener(d, "error",
                function() {
                    c.handleError(b, "Failed to load image")
                });
                u.supportsBlob() ? this.download(a, b, "blob",
                function(a) {
                    d.src = u._URL.createObjectURL(a)
                }) : d.src = a;
                break;
            case 5:
            case 6:
            case 7:
                this.download(a, b, "arraybuffer",
                function() {
                    var a = c._platform.getRenderer().createCompressedTexture(b.format, null);
                    null != a ? c.handleLoad(b, a) : c.handleTextureError(b)
                });
                break;
            case 8:
            case 9:
            case 10:
            case 11:
            case 12:
                if (s.get_supported()) this.download(a, b, "arraybuffer",
                function(a) {
                    s.ctx.decodeAudioData(a,
                    function(a) {
                        c.handleLoad(b, new s(a))
                    },
                    function() {
                        c.handleLoad(b, Z.getInstance())
                    })
                });
                else {
                    var e;
                    e = window.document.createElement("audio");
                    e.preload = "auto";
                    var f = ++u._mediaRefCount;
                    null == u._mediaElements && (u._mediaElements = new aa);
                    u._mediaElements.set(f, e);
                    g = new Na;
                    g.addDisposingListener(e, "canplaythrough",
                    function() {
                        u._mediaElements.remove(f);
                        c.handleLoad(b, new Pa(e))
                    });
                    g.addDisposingListener(e, "error",
                    function() {
                        u._mediaElements.remove(f);
                        var a = e.error.code;
                        3 == a || 4 == a ? c.handleLoad(b, Z.getInstance()) : c.handleError(b, "Failed to load audio: " + e.error.code)
                    });
                    g.addListener(e, "progress",
                    function() {
                        if (0 < e.buffered.length && 0 < e.duration) {
                            var a = e.buffered.end(0) / e.duration;
                            c.handleProgress(b, a * b.bytes | 0)
                        }
                    });
                    e.src = a;
                    e.load()
                }
                break;
            case 13:
                this.download(a, b, "text",
                function(a) {
                    c.handleLoad(b, new Ma(a))
                })
            }
        },
        getAssetFormats: function(a) {
            var b = this;
            null == u._supportedFormats && (u._supportedFormats = new mb, u.detectImageFormats(function(a) {
                u._supportedFormats.set_result(b._platform.getRenderer().getCompressedTextureFormats().concat(a).concat(u.detectAudioFormats()).concat([h.Data]))
            }));
            u._supportedFormats.get(a)
        },
        download: function(a, b, c, d) {
            var g = this,
            e = null,
            f = null,
            h = 0,
            k = !1,
            i = function() {
                k && (k = !1, window.clearInterval(h))
            },
            l = 3,
            m = function() {--l;
                return 0 <= l ? (f(), !0) : !1
            },
            f = function() {
                i();
                null != e && e.abort();
                e = new XMLHttpRequest;
                e.open("GET", a, !0);
                e.responseType = c;
                var f = 0;
                e.onprogress = function(a) {
                    k || (k = !0, h = window.setInterval(function() {
                        4 != e.readyState && 5E3 < Date.now() - f && !m() && (i(), g.handleError(b, "Download stalled"))
                    },
                    1E3));
                    f = Date.now();
                    g.handleProgress(b, a.loaded)
                };
                e.onerror = function() {
                    if (0 != e.status || !m()) i(),
                    g.handleError(b, "HTTP error " + e.status)
                };
                e.onload = function() {
                    var a = e.response;
                    null == a && (a = e.responseText);
                    i();
                    d(a)
                };
                e.send()
            };
            f()
        },
        __class__: u
    });
    var Ya = function(a, b) {
        U.call(this, a);
        this._canvas = b
    };
    f["flambe.platform.html.HtmlMouse"] = Ya;
    Ya.__name__ = ["flambe", "platform", "html", "HtmlMouse"];
    Ya.__super__ = U;
    Ya.prototype = v(U.prototype, {
        __class__: Ya
    });
    var Pa = function(a) {
        this._disposed = !1;
        this.audioElement = a
    };
    f["flambe.platform.html.HtmlSound"] = Pa;
    Pa.__name__ = ["flambe", "platform", "html", "HtmlSound"];
    Pa.__interfaces__ = [Da];
    Pa.__super__ = M;
    Pa.prototype = v(M.prototype, {
        play: function(a) {
            null == a && (a = 1);
            return new Qa(this, a, !1)
        },
        loop: function(a) {
            null == a && (a = 1);
            return new Qa(this, a, !0)
        },
        onDisposed: function() {
            this.audioElement = null
        },
        __class__: Pa
    });
    var Qa = function(a, b, c) {
        var d = this;
        this._sound = a;
        this._tickableAdded = !1;
        this._clonedElement = window.document.createElement("audio");
        this._clonedElement.loop = c;
        this._clonedElement.src = a.audioElement.src;
        this.volume = new B(b,
        function() {
            d.updateVolume()
        });
        this.updateVolume();
        this._complete = new K(!1);
        this.playAudio();
        l.hidden._value && this.set_paused(!0)
    };
    f["flambe.platform.html._HtmlSound.HtmlPlayback"] = Qa;
    Qa.__name__ = ["flambe", "platform", "html", "_HtmlSound", "HtmlPlayback"];
    Qa.__interfaces__ = [sb, Ea];
    Qa.prototype = {
        get_sound: function() {
            return this._sound
        },
        set_paused: function(a) {
            this._clonedElement.paused != a && (a ? this._clonedElement.pause() : this.playAudio());
            return a
        },
        update: function(a) {
            this.volume.update(a);
            this._complete.set__(this._clonedElement.ended);
            return this._complete._value || this._clonedElement.paused ? (this._tickableAdded = !1, this._volumeBinding.dispose(), this._hideBinding.dispose(), !0) : !1
        },
        dispose: function() {
            this.set_paused(!0);
            this._complete.set__(!0)
        },
        playAudio: function() {
            var a = this;
            this._clonedElement.play();
            this._tickableAdded || (na.instance.mainLoop.addTickable(this), this._tickableAdded = !0, this._volumeBinding = l.volume.get_changed().connect(function() {
                a.updateVolume()
            }), this._hideBinding = l.hidden.get_changed().connect(function(b) {
                b ? (a._wasPaused = a._clonedElement.paused, a.set_paused(!0)) : a.set_paused(a._wasPaused)
            }))
        },
        updateVolume: function() {
            this._clonedElement.volume = l.volume._value * this.volume._value
        },
        __class__: Qa,
        __properties__: {
            get_sound: "get_sound",
            set_paused: "set_paused"
        }
    };
    var Rb = function() {};
    f["flambe.subsystem.StageSystem"] = Rb;
    Rb.__name__ = ["flambe", "subsystem", "StageSystem"];
    Rb.prototype = {
        __class__: Rb
    };
    var xa = function(a) {
        var b = this;
        this._canvas = a;
        this.resize = new oa;
        this.scaleFactor = xa.computeScaleFactor();
        1 != this.scaleFactor && (n.setVendorStyle(this._canvas, "transform-origin", "top left"), n.setVendorStyle(this._canvas, "transform", "scale(" + 1 / this.scaleFactor + ")"));
        n.SHOULD_HIDE_MOBILE_BROWSER && (window.addEventListener("orientationchange",
        function() {
            n.callLater(fa(b, b.hideMobileBrowser), 200)
        },
        !1), this.hideMobileBrowser());
        window.addEventListener("resize", fa(this, this.onWindowResize), !1);
        this.onWindowResize(null);
        this.orientation = new K(null);
        null != window.orientation && (window.addEventListener("orientationchange", fa(this, this.onOrientationChange), !1), this.onOrientationChange(null));
        this.fullscreen = new K(!1);
        n.addVendorListener(window.document, "fullscreenchange",
        function() {
            b.updateFullscreen()
        },
        !1);
        this.updateFullscreen()
    };
    f["flambe.platform.html.HtmlStage"] = xa;
    xa.__name__ = ["flambe", "platform", "html", "HtmlStage"];
    xa.__interfaces__ = [Rb];
    xa.computeScaleFactor = function() {
        var a = window.devicePixelRatio;
        null == a && (a = 1);
        var b = window.document.createElement("canvas").getContext("2d"),
        b = n.loadExtension("backingStorePixelRatio", b).value;
        null == b && (b = 1);
        a /= b;
        b = window.screen.height;
        return 1536 < a * window.screen.width || 1536 < a * b ? 1 : a
    };
    xa.prototype = {
        get_width: function() {
            return this._canvas.width
        },
        get_height: function() {
            return this._canvas.height
        },
        lockOrientation: function(a) {
            var b = n.loadExtension("lockOrientation", window.screen).value;
            if (null != b) {
                var c;
                switch (a[1]) {
                case 0:
                    c = "portrait";
                    break;
                case 1:
                    c = "landscape"
                }
                b.apply(window.screen, [c]) || null
            }
        },
        requestFullscreen: function(a) {
            null == a && (a = !0);
            if (a) {
                var a = window.document.documentElement,
                b = n.loadFirstExtension(["requestFullscreen", "requestFullScreen"], a).value;
                null != b && b.apply(a, [])
            } else a = n.loadFirstExtension(["cancelFullscreen", "cancelFullScreen"], window.document).value,
            null != a && z.callMethod(window.document, a, [])
        },
        onWindowResize: function() {
            var a = this._canvas.parentElement.getBoundingClientRect();
            this.resizeCanvas(a.width, a.height)
        },
        resizeCanvas: function(a, b) {
            var c = this.scaleFactor * a,
            d = this.scaleFactor * b;
            if (this._canvas.width == c && this._canvas.height == d) return ! 1;
            this._canvas.width = c | 0;
            this._canvas.height = d | 0;
            this.resize.emit();
            return ! 0
        },
        hideMobileBrowser: function() {
            var a = this,
            b = window.document.documentElement.style;
            b.height = window.innerHeight + 100 + "px";
            b.width = window.innerWidth + "px";
            b.overflow = "visible";
            n.callLater(function() {
                n.hideMobileBrowser();
                n.callLater(function() {
                    b.height = window.innerHeight + "px";
                    a.onWindowResize(null)
                },
                100)
            })
        },
        onOrientationChange: function() {
            this.orientation.set__(n.orientation(window.orientation))
        },
        updateFullscreen: function() {
            this.fullscreen.set__(!0 == n.loadFirstExtension(["fullscreen", "fullScreen", "isFullScreen"], window.document).value)
        },
        __class__: xa,
        __properties__: {
            get_height: "get_height",
            get_width: "get_width"
        }
    };
    var ab = function(a) {
        this._storage = a
    };
    f["flambe.platform.html.HtmlStorage"] = ab;
    ab.__name__ = ["flambe", "platform", "html", "HtmlStorage"];
    ab.__interfaces__ = [pb];
    ab.prototype = {
        set: function(a, b) {
            var c;
            try {
                var d = new ia;
                d.useCache = !0;
                d.useEnumIndex = !1;
                d.serialize(b);
                c = d.toString()
            } catch(e) {
                return ! 1
            }
            try {
                this._storage.setItem("flambe:" + a, c)
            } catch(f) {
                return ! 1
            }
            return ! 0
        },
        get: function(a, b) {
            var c = null;
            try {
                c = this._storage.getItem("flambe:" + a)
            } catch(d) {
                null
            }
            if (null != c) try {
                return O.run(c)
            } catch(e) {
                null
            }
            return b
        },
        __class__: ab
    };
    var n = function() {};
    f["flambe.platform.html.HtmlUtil"] = n;
    n.__name__ = ["flambe", "platform", "html", "HtmlUtil"];
    n.callLater = function(a, b) {
        null == b && (b = 0);
        window.setTimeout(a, b)
    };
    n.hideMobileBrowser = function() {
        window.scrollTo(1, 0)
    };
    n.loadExtension = function(a, b) {
        null == b && (b = window);
        var c = z.field(b, a);
        if (null != c) return {
            prefix: "",
            field: a,
            value: c
        };
        for (var c = a.charAt(0).toUpperCase() + t.substr(a, 1, null), d = 0, e = n.VENDOR_PREFIXES; d < e.length;) {
            var f = e[d]; ++d;
            var h = f + c,
            i = z.field(b, h);
            if (null != i) return {
                prefix: f,
                field: h,
                value: i
            }
        }
        return {
            prefix: null,
            field: null,
            value: null
        }
    };
    n.loadFirstExtension = function(a, b) {
        for (var c = 0; c < a.length;) {
            var d = a[c]; ++c;
            d = n.loadExtension(d, b);
            if (null != d.field) return d
        }
        return {
            prefix: null,
            field: null,
            value: null
        }
    };
    n.polyfill = function(a, b) {
        null == b && (b = window);
        var c = n.loadExtension(a, b).value;
        if (null == c) return ! 1;
        b[a] = c;
        return ! 0
    };
    n.setVendorStyle = function(a, b, c) {
        for (var a = a.style,
        d = 0,
        e = n.VENDOR_PREFIXES; d < e.length;) {
            var f = e[d]; ++d;
            a.setProperty("-" + f + "-" + b, c)
        }
        a.setProperty(b, c)
    };
    n.addVendorListener = function(a, b, c, d) {
        for (var e = 0,
        f = n.VENDOR_PREFIXES; e < f.length;) {
            var h = f[e]; ++e;
            a.addEventListener(h + b, c, d)
        }
        a.addEventListener(b, c, d)
    };
    n.orientation = function(a) {
        switch (a) {
        case - 90 : case 90:
            return ea.Landscape;
        default:
            return ea.Portrait
        }
    };
    n.createEmptyCanvas = function(a, b) {
        var c;
        c = window.document.createElement("canvas");
        c.width = a;
        c.height = b;
        return c
    };
    n.createCanvas = function(a) {
        var b = n.createEmptyCanvas(a.width, a.height),
        c = b.getContext("2d");
        c.save();
        c.globalCompositeOperation = "copy";
        c.drawImage(a, 0, 0);
        c.restore();
        return b
    };
    n.fixAndroidMath = function() {
        if (0 <= window.navigator.userAgent.indexOf("Linux; U; Android 4")) {
            var a = Math.sin,
            b = Math.cos;
            Math.sin = function(b) {
                return 0 == b ? 0 : a(b)
            };
            Math.cos = function(a) {
                return 0 == a ? 1 : b(a)
            }
        }
    };
    var s = function(a) {
        this._disposed = !1;
        this.buffer = a
    };
    f["flambe.platform.html.WebAudioSound"] = s;
    s.__name__ = ["flambe", "platform", "html", "WebAudioSound"];
    s.__interfaces__ = [Da];
    s.__properties__ = {
        get_supported: "get_supported"
    };
    s.get_supported = function() {
        if (s._detectSupport) {
            s._detectSupport = !1;
            var a = n.loadExtension("AudioContext").value;
            null != a && (s.ctx = new a, s.gain = s.createGain(), s.gain.connect(s.ctx.destination), l.volume.watch(function(a) {
                s.gain.gain.value = a
            }))
        }
        return null != s.ctx
    };
    s.createGain = function() {
        return null != s.ctx.createGain ? s.ctx.createGain() : s.ctx.createGainNode()
    };
    s.start = function(a, b) {
        null != a.start ? a.start(b) : a.noteOn(b)
    };
    s.__super__ = M;
    s.prototype = v(M.prototype, {
        play: function(a) {
            null == a && (a = 1);
            return new Ra(this, a, !1)
        },
        loop: function(a) {
            null == a && (a = 1);
            return new Ra(this, a, !0)
        },
        get_duration: function() {
            return this.buffer.duration
        },
        onDisposed: function() {
            this.buffer = null
        },
        __class__: s,
        __properties__: {
            get_duration: "get_duration"
        }
    });
    var Ra = function(a, b, c) {
        var d = this;
        this._sound = a;
        this._head = s.gain;
        this._complete = new K(!1);
        this._sourceNode = s.ctx.createBufferSource();
        this._sourceNode.buffer = a.buffer;
        this._sourceNode.loop = c;
        this._sourceNode.onended = function() {
            d._complete.set__(!0)
        };
        s.start(this._sourceNode, 0);
        this.playAudio();
        this.volume = new B(b,
        function(a) {
            d.setVolume(a)
        });
        1 != b && this.setVolume(b);
        l.hidden._value && this.set_paused(!0)
    };
    f["flambe.platform.html._WebAudioSound.WebAudioPlayback"] = Ra;
    Ra.__name__ = ["flambe", "platform", "html", "_WebAudioSound", "WebAudioPlayback"];
    Ra.__interfaces__ = [sb, Ea];
    Ra.prototype = {
        get_sound: function() {
            return this._sound
        },
        set_paused: function(a) {
            a != 0 <= this._pausedAt && (a ? (this._sourceNode.disconnect(), this._pausedAt = this.get_position()) : this.playAudio());
            return a
        },
        get_position: function() {
            return this._complete._value ? this._sound.get_duration() : 0 <= this._pausedAt ? this._pausedAt: (s.ctx.currentTime - this._startedAt) % this._sound.get_duration()
        },
        update: function(a) {
            this.volume.update(a);
            3 == this._sourceNode.playbackState && this._complete.set__(!0);
            return this._complete._value || 0 <= this._pausedAt ? (this._tickableAdded = !1, this._hideBinding.dispose(), !0) : !1
        },
        dispose: function() {
            this.set_paused(!0);
            this._complete.set__(!0)
        },
        setVolume: function(a) {
            null == this._gainNode && (this._gainNode = s.createGain(), this.insertNode(this._gainNode));
            this._gainNode.gain.value = a
        },
        insertNode: function(a) {
            0 <= this._pausedAt || (this._sourceNode.disconnect(), this._sourceNode.connect(a));
            a.connect(this._head);
            this._head = a
        },
        playAudio: function() {
            var a = this;
            this._sourceNode.connect(this._head);
            this._startedAt = s.ctx.currentTime;
            this._pausedAt = -1;
            this._tickableAdded || (na.instance.mainLoop.addTickable(this), this._tickableAdded = !0, this._hideBinding = l.hidden.get_changed().connect(function(b) {
                b ? (a._wasPaused = 0 <= a._pausedAt, a.set_paused(!0)) : a.set_paused(a._wasPaused)
            }))
        },
        __class__: Ra,
        __properties__: {
            get_position: "get_position",
            get_sound: "get_sound",
            set_paused: "set_paused"
        }
    };
    var vb = function() {
        this._width = this._height = -1;
        this._transitor = null;
        this.scenes = [];
        this.occludedScenes = [];
        this._root = new G
    };
    f["flambe.scene.Director"] = vb;
    vb.__name__ = ["flambe", "scene", "Director"];
    vb.__super__ = C;
    vb.prototype = v(C.prototype, {
        get_name: function() {
            return "Director_5"
        },
        setSize: function(a, b) {
            this._width = a;
            this._height = b;
            return this
        },
        pushScene: function(a, b) {
            var c = this;
            this.completeTransition();
            var d = this.get_topScene();
            null != d ? this.playTransition(d, a, b,
            function() {
                c.hide(d)
            }) : (this.add(a), this.invalidateVisibility())
        },
        popScene: function(a) {
            var b = this;
            this.completeTransition();
            var c = this.get_topScene();
            if (null != c) {
                this.scenes.pop();
                var d = this.get_topScene();
                null != d ? this.playTransition(c, d, a,
                function() {
                    b.hideAndDispose(c)
                }) : (this.hideAndDispose(c), this.invalidateVisibility())
            }
        },
        unwindToScene: function(a, b) {
            var c = this;
            this.completeTransition();
            var d = this.get_topScene();
            if (null != d) {
                if (d != a) {
                    for (this.scenes.pop(); 0 < this.scenes.length && this.scenes[this.scenes.length - 1] != a;) this.scenes.pop().dispose();
                    this.playTransition(d, a, b,
                    function() {
                        c.hideAndDispose(d)
                    })
                }
            } else this.pushScene(a, b)
        },
        onAdded: function() {
            this.owner.addChild(this._root)
        },
        onRemoved: function() {
            this.completeTransition();
            for (var a = 0,
            b = this.scenes; a < b.length;) {
                var c = b[a]; ++a;
                c.dispose()
            }
            this.scenes = [];
            this.occludedScenes = [];
            this._root.dispose()
        },
        onUpdate: function(a) {
            null != this._transitor && this._transitor.update(a) && this.completeTransition()
        },
        get_topScene: function() {
            var a = this.scenes.length;
            return 0 < a ? this.scenes[a - 1] : null
        },
        add: function(a) {
            var b = this.get_topScene();
            null != b && this._root.removeChild(b);
            t.remove(this.scenes, a);
            this.scenes.push(a);
            this._root.addChild(a)
        },
        hide: function(a) {
            a = a._compMap.Scene_4;
            null != a && a.hidden.emit()
        },
        hideAndDispose: function(a) {
            this.hide(a);
            a.dispose()
        },
        show: function(a) {
            a = a._compMap.Scene_4;
            null != a && a.shown.emit()
        },
        invalidateVisibility: function() {
            for (var a = this.scenes.length; 0 < a;) {
                var b = this.scenes[--a]._compMap.Scene_4;
                if (null == b || b.opaque) break
            }
            this.occludedScenes = 0 < this.scenes.length ? this.scenes.slice(a, this.scenes.length - 1) : [];
            a = this.get_topScene();
            null != a && this.show(a)
        },
        completeTransition: function() {
            null != this._transitor && (this._transitor.complete(), this._transitor = null, this.invalidateVisibility())
        },
        playTransition: function(a, b, c, d) {
            this.completeTransition();
            this.add(b);
            null != c ? (this.occludedScenes.push(a), this._transitor = new Sb(a, b, c, d), this._transitor.init(this)) : (d(), this.invalidateVisibility())
        },
        get_width: function() {
            return 0 > this._width ? l._platform.getStage().get_width() : this._width
        },
        get_height: function() {
            return 0 > this._height ? l._platform.getStage().get_height() : this._height
        },
        __class__: vb,
        __properties__: v(C.prototype.__properties__, {
            get_height: "get_height",
            get_width: "get_width",
            get_topScene: "get_topScene"
        })
    });
    var Sb = function(a, b, c, d) {
        this._from = a;
        this._to = b;
        this._transition = c;
        this._onComplete = d
    };
    f["flambe.scene._Director.Transitor"] = Sb;
    Sb.__name__ = ["flambe", "scene", "_Director", "Transitor"];
    Sb.prototype = {
        init: function(a) {
            this._transition.init(a, this._from, this._to)
        },
        update: function(a) {
            return this._transition.update(a)
        },
        complete: function() {
            this._transition.complete();
            this._onComplete()
        },
        __class__: Sb
    };
    var Sa = function() {};
    f["flambe.scene.Transition"] = Sa;
    Sa.__name__ = ["flambe", "scene", "Transition"];
    Sa.prototype = {
        init: function(a, b, c) {
            this._director = a;
            this._from = b;
            this._to = c
        },
        update: function() {
            return ! 0
        },
        complete: function() {},
        __class__: Sa
    };
    var V = function(a, b) {
        this._duration = a;
        this._ease = null != b ? b: m.linear
    };
    f["flambe.scene.TweenTransition"] = V;
    V.__name__ = ["flambe", "scene", "TweenTransition"];
    V.__super__ = Sa;
    V.prototype = v(Sa.prototype, {
        init: function(a, b, c) {
            Sa.prototype.init.call(this, a, b, c);
            this._elapsed = 0
        },
        update: function(a) {
            this._elapsed += a;
            return this._elapsed >= this._duration
        },
        interp: function(a, b) {
            return a + (b - a) * this._ease(this._elapsed / this._duration)
        },
        __class__: V
    });
    var pa = function(a, b) {
        V.call(this, a, b)
    };
    f["flambe.scene.FadeTransition"] = pa;
    pa.__name__ = ["flambe", "scene", "FadeTransition"];
    pa.__super__ = V;
    pa.prototype = v(V.prototype, {
        init: function(a, b, c) {
            V.prototype.init.call(this, a, b, c);
            a = this._to._compMap.Sprite_0;
            null == a && this._to.add(a = new r);
            a.alpha.set__(0)
        },
        update: function(a) {
            a = V.prototype.update.call(this, a);
            this._to._compMap.Sprite_0.alpha.set__(this.interp(0, 1));
            return a
        },
        complete: function() {
            this._to._compMap.Sprite_0.alpha.set__(1)
        },
        __class__: pa
    });
    var ja = function(a) {
        null == a && (a = !0);
        this.opaque = a;
        this.shown = new oa;
        this.hidden = new oa
    };
    f["flambe.scene.Scene"] = ja;
    ja.__name__ = ["flambe", "scene", "Scene"];
    ja.__super__ = C;
    ja.prototype = v(C.prototype, {
        get_name: function() {
            return "Scene_4"
        },
        __class__: ja
    });
    var wb = function(a, b) {
        this._direction = 2;
        V.call(this, a, b)
    };
    f["flambe.scene.SlideTransition"] = wb;
    wb.__name__ = ["flambe", "scene", "SlideTransition"];
    wb.__super__ = V;
    wb.prototype = v(V.prototype, {
        left: function() {
            this._direction = 2;
            return this
        },
        init: function(a, b, c) {
            V.prototype.init.call(this, a, b, c);
            switch (this._direction) {
            case 0:
                this._x = 0;
                this._y = -this._director.get_height();
                break;
            case 1:
                this._x = 0;
                this._y = this._director.get_height();
                break;
            case 2:
                this._x = -this._director.get_width();
                this._y = 0;
                break;
            case 3:
                this._x = this._director.get_width(),
                this._y = 0
            }
            a = this._from._compMap.Sprite_0;
            null == a && this._from.add(a = new r);
            a.setXY(0, 0);
            a = this._to._compMap.Sprite_0;
            null == a && this._to.add(a = new r);
            a.setXY( - this._x, -this._y)
        },
        update: function(a) {
            a = V.prototype.update.call(this, a);
            this._from._compMap.Sprite_0.setXY(this.interp(0, this._x), this.interp(0, this._y));
            this._to._compMap.Sprite_0.setXY(this.interp( - this._x, 0), this.interp( - this._y, 0));
            return a
        },
        complete: function() {
            this._from._compMap.Sprite_0.setXY(0, 0);
            this._to._compMap.Sprite_0.setXY(0, 0)
        },
        __class__: wb
    });
    var ka = function() {};
    f["flambe.script.Action"] = ka;
    ka.__name__ = ["flambe", "script", "Action"];
    ka.prototype = {
        __class__: ka
    };
    var xb = function(a, b, c, d) {
        this._value = a;
        this._to = b;
        this._seconds = c;
        this._easing = d
    };
    f["flambe.script.AnimateTo"] = xb;
    xb.__name__ = ["flambe", "script", "AnimateTo"];
    xb.__interfaces__ = [ka];
    xb.prototype = {
        update: function(a) {
            null == this._tween && (this._tween = new Ka(this._value._value, this._to, this._seconds, this._easing), this._value.set_behavior(this._tween), this._value.update(a));
            if (this._value._behavior != this._tween) {
                var b = this._tween.elapsed - this._seconds;
                this._tween = null;
                return 0 < b ? a - b: 0
            }
            return - 1
        },
        __class__: xb
    };
    var P = function(a) {
        this._fn = a
    };
    f["flambe.script.CallFunction"] = P;
    P.__name__ = ["flambe", "script", "CallFunction"];
    P.__interfaces__ = [ka];
    P.prototype = {
        update: function() {
            this._fn();
            return 0
        },
        __class__: P
    };
    var $ = function(a) {
        this._duration = a;
        this._elapsed = 0
    };
    f["flambe.script.Delay"] = $;
    $.__name__ = ["flambe", "script", "Delay"];
    $.__interfaces__ = [ka];
    $.prototype = {
        update: function(a) {
            this._elapsed += a;
            if (this._elapsed >= this._duration) {
                var b = this._elapsed - this._duration;
                this._elapsed = 0;
                return a - b
            }
            return - 1
        },
        __class__: $
    };
    var yb = function(a) {
        this._completedActions = [];
        this._runningActions = null != a ? a.slice() : []
    };
    f["flambe.script.Parallel"] = yb;
    yb.__name__ = ["flambe", "script", "Parallel"];
    yb.__interfaces__ = [ka];
    yb.prototype = {
        update: function(a, b) {
            for (var c = !0,
            d = 0,
            e = 0,
            f = this._runningActions.length; e < f;) {
                var h = e++,
                i = this._runningActions[h];
                if (null != i) {
                    var k = i.update(a, b);
                    0 <= k ? (this._runningActions[h] = null, this._completedActions.push(i), k > d && (d = k)) : c = !1
                }
            }
            return c ? (this._runningActions = this._completedActions, this._completedActions = [], d) : -1
        },
        __class__: yb
    };
    var zb = function(a, b) {
        null == b && (b = -1);
        this._action = a;
        this._remaining = this._count = b
    };
    f["flambe.script.Repeat"] = zb;
    zb.__name__ = ["flambe", "script", "Repeat"];
    zb.__interfaces__ = [ka];
    zb.prototype = {
        update: function(a, b) {
            if (0 == this._count) return 0;
            var c = this._action.update(a, b);
            return 0 < this._count && 0 <= c && 0 == --this._remaining ? (this._remaining = this._count, c) : -1
        },
        __class__: zb
    };
    var ga = function() {
        this.stopAll()
    };
    f["flambe.script.Script"] = ga;
    ga.__name__ = ["flambe", "script", "Script"];
    ga.__super__ = C;
    ga.prototype = v(C.prototype, {
        get_name: function() {
            return "Script_3"
        },
        run: function(a) {
            a = new Ab(a);
            this._handles.push(a);
            return a
        },
        stopAll: function() {
            this._handles = []
        },
        onUpdate: function(a) {
            for (var b = 0; b < this._handles.length;) {
                var c = this._handles[b];
                c.removed || 0 <= c.action.update(a, this.owner) ? this._handles.splice(b, 1) : ++b
            }
        },
        __class__: ga
    });
    var Ab = function(a) {
        this.removed = !1;
        this.action = a
    };
    f["flambe.script._Script.Handle"] = Ab;
    Ab.__name__ = ["flambe", "script", "_Script", "Handle"];
    Ab.__interfaces__ = [da];
    Ab.prototype = {
        dispose: function() {
            this.removed = !0;
            this.action = null
        },
        __class__: Ab
    };
    var ha = function(a) {
        this._idx = 0;
        this._runningActions = null != a ? a.slice() : []
    };
    f["flambe.script.Sequence"] = ha;
    ha.__name__ = ["flambe", "script", "Sequence"];
    ha.__interfaces__ = [ka];
    ha.prototype = {
        add: function(a) {
            this._runningActions.push(a)
        },
        update: function(a, b) {
            for (var c = 0;;) {
                var d = this._runningActions[this._idx];
                if (null != d) if (d = d.update(a - c, b), 0 <= d) c += d;
                else return - 1; ++this._idx;
                if (this._idx >= this._runningActions.length) {
                    this._idx = 0;
                    break
                } else if (c > a) return - 1
            }
            return c
        },
        __class__: ha
    };
    var Ga = function(a, b, c) {
        this._strengthX = a;
        this._strengthY = b;
        this._duration = c;
        this._elapsed = 0
    };
    f["flambe.script.Shake"] = Ga;
    Ga.__name__ = ["flambe", "script", "Shake"];
    Ga.__interfaces__ = [ka];
    Ga.prototype = {
        update: function(a, b) {
            var c = b._compMap.Sprite_0;
            null == this._jitterX && (this._jitterX = new qa(c.x._value, this._strengthX), this._jitterY = new qa(c.y._value, this._strengthY), c.x.set_behavior(this._jitterX), c.y.set_behavior(this._jitterY));
            this._elapsed += a;
            if (this._elapsed >= this._duration) {
                var d = this._elapsed - this._duration;
                c.x._behavior == this._jitterX && c.x.set__(this._jitterX.base);
                c.y._behavior == this._jitterY && c.y.set__(this._jitterY.base);
                this._jitterY = this._jitterX = null;
                this._elapsed = 0;
                return a - d
            }
            return - 1
        },
        __class__: Ga
    };
    var ca = f["flambe.subsystem.RendererType"] = {
        __ename__: ["flambe", "subsystem", "RendererType"],
        __constructs__: ["Stage3D", "WebGL", "Canvas"]
    };
    ca.Stage3D = ["Stage3D", 0];
    ca.Stage3D.toString = q;
    ca.Stage3D.__enum__ = ca;
    ca.WebGL = ["WebGL", 1];
    ca.WebGL.toString = q;
    ca.WebGL.__enum__ = ca;
    ca.Canvas = ["Canvas", 2];
    ca.Canvas.toString = q;
    ca.Canvas.__enum__ = ca;
    var $b = function() {};
    f["flambe.util.Assert"] = $b;
    $b.__name__ = ["flambe", "util", "Assert"];
    $b.that = function() {};
    var ac = function() {};
    f["flambe.util.BitSets"] = ac;
    ac.__name__ = ["flambe", "util", "BitSets"];
    ac.set = function(a, b, c) {
        return c ? a | b: a & ~b
    };
    var Ta = function() {
        this.mainSection = new N;
        this.sections = new N
    };
    f["flambe.util.Config"] = Ta;
    Ta.__name__ = ["flambe", "util", "Config"];
    Ta.parse = function(a) {
        for (var b = new Ta,
        c = new W("^\\s*;", ""), d = new W("^\\s*\\[\\s*([^\\]]*)\\s*\\]", ""), e = new W("^\\s*([\\w\\.\\-_]+)\\s*=\\s*(.*)", ""), f = b.mainSection, h = 0, a = (new W("\r\n|\r|\n", "g")).split(a); h < a.length;) {
            var i = a[h]; ++h;
            if (!c.match(i)) if (d.match(i)) i = d.matched(1),
            b.sections.exists(i) ? f = b.sections.get(i) : (f = new N, b.sections.set(i, f));
            else if (e.match(i)) {
                var i = e.matched(1),
                k = e.matched(2),
                l = k.charCodeAt(0);
                if ((34 == l || 39 == l) && k.charCodeAt(k.length - 1) == l) k = t.substr(k, 1, k.length - 2);
                k = F.replace(F.replace(F.replace(F.replace(F.replace(F.replace(k, "\\n", "\n"), "\\r", "\r"), "\\t", "\t"), "\\'", "'"), '\\"', '"'), "\\\\", "\\");
                f.set(i, k)
            }
        }
        return b
    };
    Ta.prototype = {
        __class__: Ta
    };
    var Ua = function(a) {
        this.config = a;
        this.missingTranslation = new A
    };
    f["flambe.util.MessageBundle"] = Ua;
    Ua.__name__ = ["flambe", "util", "MessageBundle"];
    Ua.parse = function(a) {
        return new Ua(Ta.parse(a))
    };
    Ua.prototype = {
        __class__: Ua
    };
    var mb = function() {
        this.success = new A;
        this.error = new A;
        this.progressChanged = new oa;
        this.hasResult = !1;
        this._total = this._progress = 0
    };
    f["flambe.util.Promise"] = mb;
    mb.__name__ = ["flambe", "util", "Promise"];
    mb.prototype = {
        set_result: function(a) {
            if (this.hasResult) throw "Promise result already assigned";
            this._result = a;
            this.hasResult = !0;
            this.success.emit(a);
            return a
        },
        get: function(a) {
            return this.hasResult ? (a(this._result), null) : this.success.connect(a).once()
        },
        set_progress: function(a) {
            this._progress != a && (this._progress = a, this.progressChanged.emit());
            return a
        },
        set_total: function(a) {
            this._total != a && (this._total = a, this.progressChanged.emit());
            return a
        },
        __class__: mb,
        __properties__: {
            set_total: "set_total",
            set_progress: "set_progress",
            set_result: "set_result"
        }
    };
    var oa = function(a) {
        H.call(this, a)
    };
    f["flambe.util.Signal0"] = oa;
    oa.__name__ = ["flambe", "util", "Signal0"];
    oa.__super__ = H;
    oa.prototype = v(H.prototype, {
        connect: function(a, b) {
            null == b && (b = !1);
            return this.connectImpl(a, b)
        },
        emit: function() {
            var a = this;
            this._head == H.DISPATCHING_SENTINEL ? this.defer(function() {
                a.emitImpl()
            }) : this.emitImpl()
        },
        emitImpl: function() {
            for (var a = this.willEmit(), b = a; null != b;) b._listener(),
            b.stayInList || b.dispose(),
            b = b._next;
            this.didEmit(a)
        },
        __class__: oa
    });
    var Eb = function(a) {
        this.next = null;
        this.fn = a
    };
    f["flambe.util._SignalBase.Task"] = Eb;
    Eb.__name__ = ["flambe", "util", "_SignalBase", "Task"];
    Eb.prototype = {
        __class__: Eb
    };
    var L = function() {};
    f["flambe.util.Strings"] = L;
    L.__name__ = ["flambe", "util", "Strings"];
    L.getFileExtension = function(a) {
        var b = a.lastIndexOf(".");
        return 0 < b ? t.substr(a, b + 1, null) : null
    };
    L.removeFileExtension = function(a) {
        var b = a.lastIndexOf(".");
        return 0 < b ? t.substr(a, 0, b) : a
    };
    L.getUrlExtension = function(a) {
        var b = a.lastIndexOf("?");
        0 <= b && (a = t.substr(a, 0, b));
        b = a.lastIndexOf("/");
        0 <= b && (a = t.substr(a, b + 1, null));
        return L.getFileExtension(a)
    };
    L.joinPath = function(a, b) {
        0 < a.length && 47 != a.charCodeAt(a.length - 1) && (a += "/");
        return a + b
    };
    L.withFields = function(a, b) {
        var c = b.length;
        if (0 < c) {
            for (var a = 0 < a.length ? a + " [": a + "[", d = 0; d < c;) {
                0 < d && (a += ", ");
                var e = b[d],
                f = b[d + 1];
                if (y.is(f, Error)) {
                    var h = f.stack;
                    null != h && (f = h)
                }
                a += e + "=" + y.string(f);
                d += 2
            }
            a += "]"
        }
        return a
    };
    var ia = function() {
        this.buf = new Xa;
        this.cache = [];
        this.useCache = ia.USE_CACHE;
        this.useEnumIndex = ia.USE_ENUM_INDEX;
        this.shash = new N;
        this.scount = 0
    };
    f["haxe.Serializer"] = ia;
    ia.__name__ = ["haxe", "Serializer"];
    ia.prototype = {
        toString: function() {
            return this.buf.b
        },
        serializeString: function(a) {
            var b = this.shash.get(a);
            null != b ? (this.buf.b += "R", this.buf.b = null == b ? this.buf.b + "null": this.buf.b + ("" + b)) : (this.shash.set(a, this.scount++), this.buf.b += "y", a = encodeURIComponent(a), this.buf.b = null == a.length ? this.buf.b + "null": this.buf.b + ("" + a.length), this.buf.b += ":", this.buf.b = null == a ? this.buf.b + "null": this.buf.b + ("" + a))
        },
        serializeRef: function(a) {
            for (var b = typeof a,
            c = 0,
            d = this.cache.length; c < d;) {
                var e = c++,
                f = this.cache[e];
                if (typeof f == b && f == a) return this.buf.b += "r",
                this.buf.b = null == e ? this.buf.b + "null": this.buf.b + ("" + e),
                !0
            }
            this.cache.push(a);
            return ! 1
        },
        serializeFields: function(a) {
            for (var b = 0,
            c = z.fields(a); b < c.length;) {
                var d = c[b]; ++b;
                this.serializeString(d);
                this.serialize(z.field(a, d))
            }
            this.buf.b += "g"
        },
        serialize: function(a) {
            var b = D["typeof"](a);
            switch (b[1]) {
            case 0:
                this.buf.b += "n";
                break;
            case 1:
                if (0 == a) {
                    this.buf.b += "z";
                    break
                }
                this.buf.b += "i";
                this.buf.b = null == a ? this.buf.b + "null": this.buf.b + ("" + a);
                break;
            case 2:
                Math.isNaN(a) ? this.buf.b += "k": Math.isFinite(a) ? (this.buf.b += "d", this.buf.b = null == a ? this.buf.b + "null": this.buf.b + ("" + a)) : this.buf.b = 0 > a ? this.buf.b + "m": this.buf.b + "p";
                break;
            case 3:
                this.buf.b = a ? this.buf.b + "t": this.buf.b + "f";
                break;
            case 6:
                b = b[2];
                if (b == String) {
                    this.serializeString(a);
                    break
                }
                if (this.useCache && this.serializeRef(a)) break;
                switch (b) {
                case Array:
                    b = 0;
                    this.buf.b += "a";
                    for (var c = a.length,
                    d = 0; d < c;) {
                        var e = d++;
                        null == a[e] ? b++:(0 < b && (1 == b ? this.buf.b += "n": (this.buf.b += "u", this.buf.b = null == b ? this.buf.b + "null": this.buf.b + ("" + b)), b = 0), this.serialize(a[e]))
                    }
                    0 < b && (1 == b ? this.buf.b += "n": (this.buf.b += "u", this.buf.b = null == b ? this.buf.b + "null": this.buf.b + ("" + b)));
                    this.buf.b += "h";
                    break;
                case Va:
                    this.buf.b += "l";
                    for (a = a.iterator(); a.hasNext();) this.serialize(a.next());
                    this.buf.b += "h";
                    break;
                case Date:
                    this.buf.b += "v";
                    this.buf.add(t.dateStr(a));
                    break;
                case N:
                    this.buf.b += "b";
                    for (b = a.keys(); b.hasNext();) c = b.next(),
                    this.serializeString(c),
                    this.serialize(a.get(c));
                    this.buf.b += "h";
                    break;
                case aa:
                    this.buf.b += "q";
                    for (b = a.keys(); b.hasNext();) c = b.next(),
                    this.buf.b += ":",
                    this.buf.b = null == c ? this.buf.b + "null": this.buf.b + ("" + c),
                    this.serialize(a.get(c));
                    this.buf.b += "h";
                    break;
                case wa:
                    this.buf.b += "M";
                    for (b = a.keys(); b.hasNext();) c = b.next(),
                    d = z.field(c, "__id__"),
                    z.deleteField(c, "__id__"),
                    this.serialize(c),
                    c.__id__ = d,
                    this.serialize(a.h[c.__id__]);
                    this.buf.b += "h";
                    break;
                case Fa:
                    d = 0;
                    e = a.length - 2;
                    b = new Xa;
                    for (c = ia.BASE64; d < e;) {
                        var f = a.get(d++),
                        h = a.get(d++),
                        i = a.get(d++);
                        b.add(c.charAt(f >> 2));
                        b.add(c.charAt((f << 4 | h >> 4) & 63));
                        b.add(c.charAt((h << 2 | i >> 6) & 63));
                        b.add(c.charAt(i & 63))
                    }
                    d == e ? (e = a.get(d++), a = a.get(d++), b.add(c.charAt(e >> 2)), b.add(c.charAt((e << 4 | a >> 4) & 63)), b.add(c.charAt(a << 2 & 63))) : d == e + 1 && (a = a.get(d++), b.add(c.charAt(a >> 2)), b.add(c.charAt(a << 4 & 63)));
                    a = b.b;
                    this.buf.b += "s";
                    this.buf.b = null == a.length ? this.buf.b + "null": this.buf.b + ("" + a.length);
                    this.buf.b += ":";
                    this.buf.b = null == a ? this.buf.b + "null": this.buf.b + ("" + a);
                    break;
                default:
                    this.useCache && this.cache.pop(),
                    null != a.hxSerialize ? (this.buf.b += "C", this.serializeString(D.getClassName(b)), this.useCache && this.cache.push(a), a.hxSerialize(this), this.buf.b += "g") : (this.buf.b += "c", this.serializeString(D.getClassName(b)), this.useCache && this.cache.push(a), this.serializeFields(a))
                }
                break;
            case 4:
                if (this.useCache && this.serializeRef(a)) break;
                this.buf.b += "o";
                this.serializeFields(a);
                break;
            case 7:
                b = b[2];
                if (this.useCache) {
                    if (this.serializeRef(a)) break;
                    this.cache.pop()
                }
                this.buf.b = this.useEnumIndex ? this.buf.b + "j": this.buf.b + "w";
                this.serializeString(D.getEnumName(b));
                this.useEnumIndex ? (this.buf.b += ":", this.buf.b += y.string(a[1])) : this.serializeString(a[0]);
                this.buf.b += ":";
                b = a.length;
                this.buf.b += y.string(b - 2);
                for (c = 2; c < b;) d = c++,
                this.serialize(a[d]);
                this.useCache && this.cache.push(a);
                break;
            case 5:
                throw "Cannot serialize function";
            default:
                throw "Cannot serialize " + y.string(a);
            }
        },
        __class__: ia
    };
    var O = function(a) {
        this.buf = a;
        this.length = a.length;
        this.pos = 0;
        this.scache = [];
        this.cache = [];
        a = O.DEFAULT_RESOLVER;
        null == a && (a = D, O.DEFAULT_RESOLVER = a);
        this.setResolver(a)
    };
    f["haxe.Unserializer"] = O;
    O.__name__ = ["haxe", "Unserializer"];
    O.initCodes = function() {
        for (var a = [], b = 0, c = O.BASE64.length; b < c;) {
            var d = b++;
            a[O.BASE64.charCodeAt(d)] = d
        }
        return a
    };
    O.run = function(a) {
        return (new O(a)).unserialize()
    };
    O.prototype = {
        setResolver: function(a) {
            this.resolver = null == a ? {
                resolveClass: function() {
                    return null
                },
                resolveEnum: function() {
                    return null
                }
            }: a
        },
        get: function(a) {
            return this.buf.charCodeAt(a)
        },
        readDigits: function() {
            for (var a = 0,
            b = !1,
            c = this.pos;;) {
                var d = this.buf.charCodeAt(this.pos);
                if (d != d) break;
                if (45 == d) {
                    if (this.pos != c) break;
                    b = !0
                } else {
                    if (48 > d || 57 < d) break;
                    a = 10 * a + (d - 48)
                }
                this.pos++
            }
            b && (a *= -1);
            return a
        },
        unserializeObject: function(a) {
            for (;;) {
                if (this.pos >= this.length) throw "Invalid object";
                if (103 == this.buf.charCodeAt(this.pos)) break;
                var b = this.unserialize();
                if ("string" != typeof b) throw "Invalid object key";
                var c = this.unserialize();
                a[b] = c
            }
            this.pos++
        },
        unserializeEnum: function(a, b) {
            if (58 != this.get(this.pos++)) throw "Invalid enum format";
            var c = this.readDigits();
            if (0 == c) return D.createEnum(a, b);
            for (var d = []; 0 < c--;) d.push(this.unserialize());
            return D.createEnum(a, b, d)
        },
        unserialize: function() {
            switch (this.get(this.pos++)) {
            case 110:
                return null;
            case 116:
                return ! 0;
            case 102:
                return ! 1;
            case 122:
                return 0;
            case 105:
                return this.readDigits();
            case 100:
                for (var a = this.pos;;) {
                    var b = this.buf.charCodeAt(this.pos);
                    if (43 <= b && 58 > b || 101 == b || 69 == b) this.pos++;
                    else break
                }
                return y.parseFloat(t.substr(this.buf, a, this.pos - a));
            case 121:
                a = this.readDigits();
                if (58 != this.get(this.pos++) || this.length - this.pos < a) throw "Invalid string length";
                b = t.substr(this.buf, this.pos, a);
                this.pos += a;
                b = decodeURIComponent(b.split("+").join(" "));
                this.scache.push(b);
                return b;
            case 107:
                return Math.NaN;
            case 109:
                return Math.NEGATIVE_INFINITY;
            case 112:
                return Math.POSITIVE_INFINITY;
            case 97:
                a = [];
                for (this.cache.push(a);;) {
                    b = this.buf.charCodeAt(this.pos);
                    if (104 == b) {
                        this.pos++;
                        break
                    }
                    117 == b ? (this.pos++, b = this.readDigits(), a[a.length + b - 1] = null) : a.push(this.unserialize())
                }
                return a;
            case 111:
                return a = {},
                this.cache.push(a),
                this.unserializeObject(a),
                a;
            case 114:
                a = this.readDigits();
                if (0 > a || a >= this.cache.length) throw "Invalid reference";
                return this.cache[a];
            case 82:
                a = this.readDigits();
                if (0 > a || a >= this.scache.length) throw "Invalid string reference";
                return this.scache[a];
            case 120:
                throw this.unserialize();
            case 99:
                a = this.unserialize();
                b = this.resolver.resolveClass(a);
                if (null == b) throw "Class not found " + a;
                a = D.createEmptyInstance(b);
                this.cache.push(a);
                this.unserializeObject(a);
                return a;
            case 119:
                a = this.unserialize();
                b = this.resolver.resolveEnum(a);
                if (null == b) throw "Enum not found " + a;
                a = this.unserializeEnum(b, this.unserialize());
                this.cache.push(a);
                return a;
            case 106:
                a = this.unserialize();
                b = this.resolver.resolveEnum(a);
                if (null == b) throw "Enum not found " + a;
                this.pos++;
                var c = this.readDigits(),
                d = D.getEnumConstructs(b)[c];
                if (null == d) throw "Unknown enum index " + a + "@" + c;
                a = this.unserializeEnum(b, d);
                this.cache.push(a);
                return a;
            case 108:
                a = new Va;
                for (this.cache.push(a); 104 != this.buf.charCodeAt(this.pos);) a.add(this.unserialize());
                this.pos++;
                return a;
            case 98:
                a = new N;
                for (this.cache.push(a); 104 != this.buf.charCodeAt(this.pos);) b = this.unserialize(),
                a.set(b, this.unserialize());
                this.pos++;
                return a;
            case 113:
                a = new aa;
                this.cache.push(a);
                for (b = this.get(this.pos++); 58 == b;) b = this.readDigits(),
                a.set(b, this.unserialize()),
                b = this.get(this.pos++);
                if (104 != b) throw "Invalid IntMap format";
                return a;
            case 77:
                a = new wa;
                for (this.cache.push(a); 104 != this.buf.charCodeAt(this.pos);) b = this.unserialize(),
                a.set(b, this.unserialize());
                this.pos++;
                return a;
            case 118:
                return a = t.substr(this.buf, this.pos, 19),
                a = t.strDate(a),
                this.cache.push(a),
                this.pos += 19,
                a;
            case 115:
                a = this.readDigits();
                d = this.buf;
                if (58 != this.get(this.pos++) || this.length - this.pos < a) throw "Invalid bytes length";
                var e = O.CODES;
                null == e && (e = O.initCodes(), O.CODES = e);
                for (var f = this.pos,
                h = a & 3,
                i = f + (a - h), b = Fa.alloc(3 * (a >> 2) + (2 <= h ? h - 1 : 0)), c = 0; f < i;) {
                    var k = e[F.fastCodeAt(d, f++)],
                    l = e[F.fastCodeAt(d, f++)];
                    b.set(c++, k << 2 | l >> 4);
                    k = e[F.fastCodeAt(d, f++)];
                    b.set(c++, l << 4 | k >> 2);
                    l = e[F.fastCodeAt(d, f++)];
                    b.set(c++, k << 6 | l)
                }
                2 <= h && (l = e[F.fastCodeAt(d, f++)], i = e[F.fastCodeAt(d, f++)], b.set(c++, l << 2 | i >> 4), 3 == h && (d = e[F.fastCodeAt(d, f++)], b.set(c++, i << 4 | d >> 2)));
                this.pos += a;
                this.cache.push(b);
                return b;
            case 67:
                a = this.unserialize();
                b = this.resolver.resolveClass(a);
                if (null == b) throw "Class not found " + a;
                a = D.createEmptyInstance(b);
                this.cache.push(a);
                a.hxUnserialize(this);
                if (103 != this.get(this.pos++)) throw "Invalid custom data";
                return a
            }
            this.pos--;
            throw "Invalid char " + this.buf.charAt(this.pos) + " at position " + this.pos;
        },
        __class__: O
    };
    var aa = function() {
        this.h = {}
    };
    f["haxe.ds.IntMap"] = aa;
    aa.__name__ = ["haxe", "ds", "IntMap"];
    aa.__interfaces__ = [Cb];
    aa.prototype = {
        set: function(a, b) {
            this.h[a] = b
        },
        get: function(a) {
            return this.h[a]
        },
        exists: function(a) {
            return this.h.hasOwnProperty(a)
        },
        remove: function(a) {
            if (!this.h.hasOwnProperty(a)) return ! 1;
            delete this.h[a];
            return ! 0
        },
        keys: function() {
            var a = [],
            b;
            for (b in this.h) this.h.hasOwnProperty(b) && a.push(b | 0);
            return t.iter(a)
        },
        __class__: aa
    };
    var wa = function() {
        this.h = {};
        this.h.__keys__ = {}
    };
    f["haxe.ds.ObjectMap"] = wa;
    wa.__name__ = ["haxe", "ds", "ObjectMap"];
    wa.__interfaces__ = [Cb];
    wa.prototype = {
        set: function(a, b) {
            var c = a.__id__ || (a.__id__ = ++wa.count);
            this.h[c] = b;
            this.h.__keys__[c] = a
        },
        keys: function() {
            var a = [],
            b;
            for (b in this.h.__keys__) this.h.hasOwnProperty(b) && a.push(this.h.__keys__[b]);
            return t.iter(a)
        },
        __class__: wa
    };
    var N = function() {
        this.h = {}
    };
    f["haxe.ds.StringMap"] = N;
    N.__name__ = ["haxe", "ds", "StringMap"];
    N.__interfaces__ = [Cb];
    N.prototype = {
        set: function(a, b) {
            this.h["$" + a] = b
        },
        get: function(a) {
            return this.h["$" + a]
        },
        exists: function(a) {
            return this.h.hasOwnProperty("$" + a)
        },
        keys: function() {
            var a = [],
            b;
            for (b in this.h) this.h.hasOwnProperty(b) && a.push(b.substr(1));
            return t.iter(a)
        },
        iterator: function() {
            return {
                ref: this.h,
                it: this.keys(),
                hasNext: function() {
                    return this.it.hasNext()
                },
                next: function() {
                    return this.ref["$" + this.it.next()]
                }
            }
        },
        __class__: N
    };
    var Fa = function(a, b) {
        this.length = a;
        this.b = b
    };
    f["haxe.io.Bytes"] = Fa;
    Fa.__name__ = ["haxe", "io", "Bytes"];
    Fa.alloc = function(a) {
        for (var b = [], c = 0; c < a;) c++,
        b.push(0);
        return new Fa(a, b)
    };
    Fa.prototype = {
        get: function(a) {
            return this.b[a]
        },
        set: function(a, b) {
            this.b[a] = b & 255
        },
        __class__: Fa
    };
    var dc = function() {};
    f["haxe.io.Eof"] = dc;
    dc.__name__ = ["haxe", "io", "Eof"];
    dc.prototype = {
        toString: function() {
            return "Eof"
        },
        __class__: dc
    };
    var Zb = function() {};
    f["haxe.rtti.Meta"] = Zb;
    Zb.__name__ = ["haxe", "rtti", "Meta"];
    Zb.getType = function(a) {
        a = a.__meta__;
        return null == a || null == a.obj ? {}: a.obj
    };
    var E = function() {};
    f["js.Boot"] = E;
    E.__name__ = ["js", "Boot"];
    E.getClass = function(a) {
        return a instanceof Array && null == a.__enum__ ? Array: a.__class__
    };
    E.__string_rec = function(a, b) {
        if (null == a) return "null";
        if (5 <= b.length) return "<...>";
        var c = typeof a;
        if ("function" == c && (a.__name__ || a.__ename__)) c = "object";
        switch (c) {
        case "object":
            if (a instanceof Array) {
                if (a.__enum__) {
                    if (2 == a.length) return a[0];
                    for (var c = a[0] + "(", b = b + "\t", d = 2, e = a.length; d < e;) var f = d++,
                    c = 2 != f ? c + ("," + E.__string_rec(a[f], b)) : c + E.__string_rec(a[f], b);
                    return c + ")"
                }
                c = a.length;
                d = "[";
                b += "\t";
                for (e = 0; e < c;) f = e++,
                d += (0 < f ? ",": "") + E.__string_rec(a[f], b);
                return d + "]"
            }
            try {
                d = a.toString
            } catch(h) {
                return "???"
            }
            if (null != d && d != Object.toString && (c = a.toString(), "[object Object]" != c)) return c;
            c = null;
            d = "{\n";
            b += "\t";
            e = null != a.hasOwnProperty;
            for (c in a) if (!e || a.hasOwnProperty(c))"prototype" == c || "__class__" == c || "__super__" == c || "__interfaces__" == c || "__properties__" == c || (2 != d.length && (d += ", \n"), d += b + c + " : " + E.__string_rec(a[c], b));
            b = b.substring(1);
            return d + ("\n" + b + "}");
        case "function":
            return "<function>";
        case "string":
            return a;
        default:
            return "" + a
        }
    };
    E.__interfLoop = function(a, b) {
        if (null == a) return ! 1;
        if (a == b) return ! 0;
        var c = a.__interfaces__;
        if (null != c) for (var d = 0,
        e = c.length; d < e;) {
            var f = d++,
            f = c[f];
            if (f == b || E.__interfLoop(f, b)) return ! 0
        }
        return E.__interfLoop(a.__super__, b)
    };
    E.__instanceof = function(a, b) {
        if (null == b) return ! 1;
        switch (b) {
        case jc:
            return (a | 0) === a;
        case gc:
            return "number" == typeof a;
        case hc:
            return "boolean" == typeof a;
        case String:
            return "string" == typeof a;
        case Array:
            return a instanceof Array && null == a.__enum__;
        case kc:
            return ! 0;
        default:
            if (null != a) {
                if ("function" == typeof b && (a instanceof b || E.__interfLoop(E.getClass(a), b))) return ! 0
            } else return ! 1;
            return b == lc && null != a.__name__ || b == mc && null != a.__ename__ ? !0 : a.__enum__ == b
        }
    };
    E.__cast = function(a, b) {
        if (E.__instanceof(a, b)) return a;
        throw "Cannot cast " + y.string(a) + " to " + y.string(b);
    };
    var Yb = function() {};
    f["js.Browser"] = Yb;
    Yb.__name__ = ["js", "Browser"];
    Yb.getLocalStorage = function() {
        try {
            var a = window.localStorage;
            a.getItem("");
            return a
        } catch(b) {
            return null
        }
    };
    var Tb = function(a) {
        this.root = (new G).add(new ja(!1));
        e.addFillSprite(this.root, e.halfWidth, e.halfHeight, 0, e.width, e.height, 0.8);
        e.addLabel(this.root, e.halfWidth, e.halfHeight - 150, "Game Over", 1.2, 1, !0, "font2");
        a = e.addLabel(this.root, e.halfWidth + 50, e.halfHeight, "" + a, 1.2, 1, !0);
        e.addImageSprite(a, -50, 25, "score_icon");
        e.addButton(this.root, e.halfWidth - 75, e.halfHeight + 170, "home_btn",
        function() {
            o.unmuteSoundtrack();
            e.goToScene((new Ha).root)
        });
        e.addButton(this.root, e.halfWidth + 75, e.halfHeight + 170, "replay_btn",
        function() {
            o.unmuteSoundtrack();
            e.goToScene((new w(0)).root)
        })
    };
    f["scenes.GameOverScene"] = Tb;
    Tb.__name__ = ["scenes", "GameOverScene"];
    Tb.prototype = {
        __class__: Tb
    };
    var w = function() {
        this.root = (new G).add(new ja);
        var a = this;
        this.root.add(new ga);
        e.addImageSprite(this.root, 0, 0, "game_scene_bg", 1, 1, !1);
        var b = e.addImageSprite(this.root, 0, -70, "spikes_block", 1, 1, !1);
        w.spikesBlock = b._compMap.Sprite_0;
        e.addImageSprite(this.root, 0, -20, "hud_bg", 1, 1, !1);
        1 == w.cLevel && (w.totalScore = 0, e.addDelay(this.root, 0.2,
        function() {
            e.pushScene((new Ub).root)
        },
        !1));
        e.addDelay(this.root, 0.8,
        function() {
            e.addButton(a.root, 585, 58, "pause_btn",
            function() {
                e.pushScene((new Vb).root)
            });
            e.addButton(a.root, 390, 58, "push_btn",
            function() {
                a.root._compMap.GameSceneComp_7.addRow()
            });
            w.spikesBlock.y.animateTo(101, 0.8, m.linear);
            a.root.add(new Bb(w.scoreTillNextLevel(w.cLevel + 1), 0))
        },
        !1)
    };
    f["scenes.GameScene"] = w;
    w.__name__ = ["scenes", "GameScene"];
    w.scoreTillNextLevel = function(a) {
        return 1E3 * a + 1E3 * a + (30 * a * a - 30 * a)
    };
    w.prototype = {
        __class__: w
    };
    var Bb = function(a, b) {
        this.levelEnd = !1;
        this.timerC = this.cLevelScore = 0;
        this.scoreTillNextLevel = a;
        this.cLevelScore = b
    };
    f["scenes.GameSceneComp"] = Bb;
    Bb.__name__ = ["scenes", "GameSceneComp"];
    Bb.__super__ = C;
    Bb.prototype = v(C.prototype, {
        get_name: function() {
            return "GameSceneComp_7"
        },
        onAdded: function() {
            this.grid = new i(this.owner, 9, 11);
            this.grid.addRandRows(8);
            this.timeTillNextRow = this.caclAddRowTimer();
            e.addLabel(this.owner, 48, 54, "" + w.cLevel, 1, 1, !0, "font3");
            e.addImageSprite(this.owner, 90, 30, "bar1_bg", 1, 1, !1);
            this.scoreBarFill = e.addImageSprite(this.owner, 90, 30, "bar1_fill", 1, 1, !1)._compMap.Sprite_0;
            this.scoreBarFillRect = new La(0, 0, 0, this.scoreBarFill.getNaturalHeight());
            this.scoreBarFill.scissor = this.scoreBarFillRect;
            this.scoreLabel = e.addLabel(this.owner, 210, 54, "", 1, 1, !0, "font3")._compMap.Sprite_0;
            this.scoreLabel.setAlign(T.Center);
            this.updateScore(0);
            e.addImageSprite(this.owner, 442, 30, "bar2_bg", 1, 1, !1);
            this.pushUpBarFill = e.addImageSprite(this.owner, 442, 30, "bar2_fill", 1, 1, !1)._compMap.Sprite_0;
            this.pushUpBarFillRect = new La(0, 0, 0, this.pushUpBarFill.getNaturalHeight());
            this.pushUpBarFill.scissor = this.pushUpBarFillRect;
            this.pushUpTimer = e.addDelay(this.owner, this.timeTillNextRow, fa(this, this.addRow), !0);
            this.timer = e.addDelay(this.owner, 0.1, fa(this, this.updateTimer), !0);
            this.checkForMatches()
        },
        caclAddRowTimer: function() {
            var a = 9 - (0.5 * w.cLevel | 0);
            2 > a && (a = 2);
            return a
        },
        checkForMatches: function() {
            this.levelEnd || (this.checkNextLevel(), 0 == this.grid.getDeepMatches().length && (this.pushUpTimer.dispose(), this.pushUpTimer = e.addDelay(this.owner, this.timeTillNextRow, fa(this, this.addRow), !0), this.addRow()))
        },
        addRow: function() {
            this.pushUpBarFillRect.width = this.pushUpBarFill.getNaturalWidth();
            this.pushUpBarFill.scissor = this.pushUpBarFillRect;
            this.timerC = 0;
            this.levelEnd || (this.grid.pushPiecesUp() ? (this.grid.addRandRows(1), 0 == this.grid.getDeepMatches().length && this.addRow()) : this.checkGameOver())
        },
        checkNextLevel: function() {
            var a = this;
            if (this.cLevelScore >= this.scoreTillNextLevel) {
                this.levelEnd = !0;
                x.canMakeAction = !1;
                w.spikesBlock.y.animateTo( - 70, 0.6, m.linear);
                this.pushUpTimer._compMap.Script_3.stopAll();
                this.timer._compMap.Script_3.stopAll();
                e.addDelay(this.owner, 1,
                function() {
                    a.grid.clear2()
                },
                !1);
                w.cLevel += 1;
                var b = this.cLevelScore - this.scoreTillNextLevel;
                w.totalScore += this.cLevelScore;
                X.saveHiScore(w.totalScore);
                o.playSfx("level_end_sfx", 1);
                this.showLevelCompleteMsg();
                e.addDelay(this.owner, 1.5,
                function() {
                    e.goToScene((new w(b)).root, (new wb(0.6, m.backIn)).left())
                },
                !1)
            }
        },
        checkGameOver: function() {
            this.levelEnd = !0;
            x.canMakeAction = !1;
            var a = X.HI_SCORE;
            w.totalScore += this.cLevelScore;
            X.saveHiScore(w.totalScore);
            this.pushUpTimer._compMap.Script_3.stopAll();
            this.timer._compMap.Script_3.stopAll();
            w.cLevel = 1;
            this.grid.clear();
            e.addDelay(this.owner, 2,
            function() {
                o.muteSoundtrack();
                o.playSfx("game_over_sfx", 1);
                e.pushScene((new Tb(w.totalScore, a)).root)
            },
            !1)
            console.log(w.totalScore);
			this.reportScore(w.totalScore);
            if(window.QuickAds != undefined){
               
            }
        },
		reportScore:function(a){
			document.location = "magic://game?score="+a;
		},
        updateScore: function(a) {
            this.cLevelScore += a;
            this.cLevelScore > this.scoreTillNextLevel && (this.cLevelScore = this.scoreTillNextLevel);
            this.scoreLabel.set_text(this.cLevelScore + " - " + this.scoreTillNextLevel);
            this.scoreBarFillRect.width = this.cLevelScore / this.scoreTillNextLevel * this.scoreBarFill.getNaturalWidth();
            this.scoreBarFill.scissor = this.scoreBarFillRect
        },
        updateTimer: function() {
            this.timerC += 0.1;
            this.timerC > this.timeTillNextRow && (this.timerC = this.timeTillNextRow);
            this.pushUpBarFillRect.width = this.timerC / this.timeTillNextRow * this.pushUpBarFill.getNaturalWidth();
            this.pushUpBarFill.scissor = this.pushUpBarFillRect
        },
        showLevelCompleteMsg: function() {
            var a;
            a = e.addFillSprite(this.owner, e.halfWidth, e.halfHeight, 0, e.width, 140, 0)._compMap.Sprite_0;
            var b;
            b = e.addLabel(this.owner, e.halfWidth, e.halfHeight, "Level Complete", 1, 0, !0, "font2")._compMap.Sprite_0;
            a.alpha.animateTo(0.8, 0.4, m.quadIn);
            b.alpha.animateTo(1, 0.4, m.quadIn)
        },
        __class__: Bb
    });
    var Ub = function() {
        this.root = (new G).add(new ja(!1));
        e.addFillSprite(this.root, e.halfWidth, e.halfHeight, 0, e.width, e.height, 0.5);
        e.addImageSprite(this.root, e.halfWidth, 380, "help_info", 1, 1);
        e.addButton(this.root, e.halfWidth, e.height - 160, "play_btn2",
        function() {
            e.popScene(new pa(0.2))
        })
    };
    f["scenes.HelpScene"] = Ub;
    Ub.__name__ = ["scenes", "HelpScene"];
    Ub.prototype = {
        __class__: Ub
    };
    var Ha = function() {
        this.root = (new G).add(new ja);
        o.playSoundtrack("soundtrack1", 0.8);
        e.addImageSprite(this.root, e.halfWidth, e.halfHeight, "game_scene_bg");
        var a;
        a = e.addImageSprite(this.root, e.halfWidth, e.halfHeight - 270, "game_title", 1, 1)._compMap.Sprite_0;
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.halfHeight - 160, 1, m.bounceOut);
        a = e.addLabel(this.root, e.halfWidth + 40, e.height + 100, "" + X.HI_SCORE, 1.2, 0, !0)._compMap.Sprite_0;
        e.addImageSprite(a.owner, -40, 15, "score_icon");
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.height - 80, 1, m.bounceOut);
        a = e.addButton(this.root, e.halfWidth, e.height - 200, "play_btn2",
        function() {
            e.goToScene((new w(0)).root)
        },
        "", 1, 0)._compMap.Sprite_0;
        a.alpha.animateTo(1, 1, m.quadOut);
        a.y.animateTo(e.height - 280, 1, m.bounceOut);
        e.addButton(this.root, e.width - 80, 90, "sound_on_btn",
        function() {
            o.muteAll()
        },
        "sound_off_btn", 1, 1)
    };
    f["scenes.MainScene"] = Ha;
    Ha.__name__ = ["scenes", "MainScene"];
    Ha.prototype = {
        __class__: Ha
    };
    var Vb = function() {
        this.root = (new G).add(new ja(!1));
        e.addFillSprite(this.root, e.halfWidth, e.halfHeight, 0, e.width, e.height, 0.8);
        e.addLabel(this.root, e.halfWidth, e.halfHeight - 205, "Paused", 1.2, 1, !0, "font2");
        e.addButton(this.root, e.halfWidth, e.halfHeight + 5, "play_btn2",
        function() {
            e.popScene(new pa(0))
        });
        e.addButton(this.root, e.halfWidth - 150, e.halfHeight + 200, "home_btn",
        function() {
            w.cLevel = 1;
            e.goToScene((new Ha).root)
        });
        e.addButton(this.root, e.halfWidth, e.halfHeight + 200, "replay_btn",
        function() {
            w.cLevel = 1;
            e.goToScene((new w(0)).root)
        });
        e.addButton(this.root, e.halfWidth + 150, e.halfHeight + 200, "sound_on_btn",
        function() {
            o.muteAll()
        },
        "sound_off_btn").firstChild._compMap.Sprite_0.set_visible(o.isMuted)
    };
    f["scenes.PauseScene"] = Vb;
    Vb.__name__ = ["scenes", "PauseScene"];
    Vb.prototype = {
        __class__: Vb
    };
    var o = function() {};
    f["yzi.Sfx"] = o;
    o.__name__ = ["yzi", "Sfx"];
    o.playSfx = function(a, b) {
        null == b && (b = 1);
        return o.isMuted ? null: e.assets.getSound(o.soundsFolder + "/" + a).play(b)
    };
    o.playSoundtrack = function(a, b) {
        null == b && (b = 1);
        var c = e.assets.getSound(o.soundsFolder + "/" + a);
        null != o.cSoundtrackPlayback ? o.cSoundtrackPlayback.get_sound() != c && (o.cSoundtrackVolume = b, o.cSoundtrackPlayback = c.loop(b)) : (o.cSoundtrackVolume = b, o.cSoundtrackPlayback = c.loop(b));
        return o.cSoundtrackPlayback
    };
    o.muteSoundtrack = function() {
        null != o.cSoundtrackPlayback && (o.cSoundtrackPlayback.volume.animateTo(0, 1), e.addDelay(null, 0.8,
        function() {
            o.cSoundtrackPlayback.set_paused(!0)
        },
        !1))
    };
    o.unmuteSoundtrack = function() {
        null != o.cSoundtrackPlayback && !o.isMuted && (o.cSoundtrackPlayback.set_paused(!1), o.cSoundtrackPlayback.volume.animateTo(o.cSoundtrackVolume, 1))
    };
    o.muteAll = function() {
        o.isMuted ? (o.isMuted = !1, o.unmuteSoundtrack(), l.volume.animateTo(1, 0)) : (o.isMuted = !0, o.muteSoundtrack(), l.volume.animateTo(0, 1))
    };
    var R = function() {};
    f["yzi.Tweener"] = R;
    R.__name__ = ["yzi", "Tweener"];
    R.to = function(a, b, c, d, e, f) {
        null == d && (d = 0);
        m;
        var h = new ha;
        0 > d && (d = 0);
        if (0 == b && 0 == d) R.apply(a, c, e);
        else {
            if (0 == b && 0 < d) {
                var i = new G;
                0 != d && h.add(new $(d));
                h.add(new P(function() {
                    R.apply(a, c, e);
                    i.dispose()
                }));
                b = new ga;
                l.root.addChild(i.add(b))
            } else {
                0 < d && h.add(new $(d));
                for (var d = [], k = 0, o = z.fields(c); k < o.length;) {
                    var n = o[k]; ++k;
                    var q = z.getProperty(a, n);
                    d.push(new xb(q, z.field(c, n), b, f))
                }
                f = new yb(d);
                h.add(f);
                var p = new G;
                h.add(new $(b));
                h.add(new P(function() {
                    null != e && e();
                    p.dispose()
                }));
                b = new ga;
                l.root.addChild(p.add(b))
            }
            b.run(h)
        }
    };
    R.apply = function(a, b, c) {
        for (var d = 0,
        e = z.fields(b); d < e.length;) {
            var f = e[d]; ++d;
            var h = z.getProperty(a, f);
            E.__cast(h, B).set__(z.field(b, f))
        }
        null != c && c()
    };
    var e = function(a, b) {
        this.init = new oa;
        var c = this;
        e.width = a;
        e.height = b;
        e.halfWidth = a / 2 | 0;
        e.halfHeight = b / 2 | 0;
        e.director = (new G).add(new r).add((new vb).setSize(e.width, e.height));
        l.root.addChild(e.director);
        this.systemBg = e.initFillSpriteComp(0, 0, e.systemBgColor, 0, 0, 1, !1);
        l.root.add(this.systemBg);
        this.leftBorder = e.addFillSprite(l.root, 0, 0, e.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
        this.rightBorder = e.addFillSprite(l.root, 0, 0, e.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
        this.topBorder = e.addFillSprite(l.root, 0, 0, e.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
        this.bottomBorder = e.addFillSprite(l.root, 0, 0, e.systemBgColor, 0, 0, 1, !1)._compMap.Sprite_0;
        l.loadAssetPack(S.fromAssets("boot")).get(function(a) {
            e.assets = a;
            a = e.addFillSprite(l.root, 0, 0, 1118481, l._platform.getStage().get_width(), l._platform.getStage().get_height(), 1, !1);
            c.rotPhonePrompt = a._compMap.Sprite_0;
            a = e.addImageSprite(c.rotPhonePrompt.owner, 0, 0, "rot_phone")._compMap.Sprite_0;
            e.defaultOrientation == ea.Landscape && a.setRotation(90); (e.defaultOrientation == l._platform.getStage().orientation._value || null == l._platform.getStage().orientation._value) && c.rotPhonePrompt.set_visible(!1);
            l._platform.getStage().lockOrientation(e.defaultOrientation);
            l._platform.getStage().requestFullscreen(!0);
            l._platform.getStage().orientation.get_changed().connect(fa(c, c.onOrientationChange));
            l._platform.getStage().resize.connect(fa(c, c.onResize));
            c.onResize();
            c.initPreloaderScene()
        })
    };
    f["yzi.YZI"] = e;
    e.__name__ = ["yzi", "YZI"];
    e.onResizeCallback = function() {};
    e.onOrientationChangeCallback = function() {};
    e.goToScene = function(a, b) {
        null == b && (b = new pa(0.5, m.quadOut));
        e.director._compMap.Director_5.unwindToScene(a, b)
    };
    e.pushScene = function(a, b) {
        null == b && (b = new pa(0.5, m.quadOut));
        e.director._compMap.Director_5.pushScene(a, b)
    };
    e.popScene = function(a) {
        null == a && (a = new pa(0.5, m.quadOut));
        e.director._compMap.Director_5.popScene(a)
    };
    e.saveData = function(a, b) {
        return l._platform.getStorage().set(a, b)
    };
    e.loadData = function(a) {
        return l._platform.getStorage().get(a)
    };
    e.initFillSpriteComp = function(a, b, c, d, e, f, h) {
        null == h && (h = !0);
        null == f && (f = 1);
        c = new fb(c, d, e);
        c.setXY(a, b);
        c.setAlpha(f);
        h && c.centerAnchor();
        return c
    };
    e.initImageSpriteComp = function(a, b, c, d, f, h) {
        null == h && (h = !0);
        null == f && (f = 1);
        null == d && (d = 1);
        c = new ib(e.assets.getTexture(c));
        c.setXY(a, b);
        c.setScale(d);
        c.setAlpha(f);
        h && c.centerAnchor();
        return c
    };
    e.initTextSpriteComp = function(a, b, c, d, f, h, i) {
        null == i && (i = "");
        null == h && (h = !1);
        null == f && (f = 1);
        null == d && (d = 1);
        null == c && (c = "Label");
        "" == i && (i = e.defaultFont);
        c = new kb(new Ba(e.assets, i), c);
        c.setXY(a, b);
        c.setScale(d);
        c.setAlpha(f);
        h && c.centerAnchor();
        return c
    };
    e.addFillSprite = function(a, b, c, d, f, h, i, l) {
        null == l && (l = !0);
        null == i && (i = 1);
        var k = new G;
        k.add(new ra);
        k.add(e.initFillSpriteComp(b, c, d, f, h, i, l));
        null != a && a.addChild(k);
        return k
    };
    e.addImageSprite = function(a, b, c, d, f, h, i) {
        null == i && (i = !0);
        null == h && (h = 1);
        null == f && (f = 1);
        var l = new G;
        l.add(new ra);
        l.add(e.initImageSpriteComp(b, c, d, f, h, i));
        null != a && a.addChild(l);
        return l
    };
    e.addLabel = function(a, b, c, d, f, h, i, l) {
        null == l && (l = "");
        null == i && (i = !1);
        null == h && (h = 1);
        null == f && (f = 1);
        null == d && (d = "Label");
        var k = new G;
        k.add(new ra);
        k.add(e.initTextSpriteComp(b, c, d, f, h, i, l));
        null != a && a.addChild(k);
        return k
    };
    e.addButton = function(a, b, c, d, f, h, i, l) {
        null == l && (l = 1);
        null == i && (i = 1);
        null == h && (h = "");
        var k = e.addImageSprite(a, b, c, d, i, l, !0);
        k.add(new ga);
        "" != h && (e.addImageSprite(k, 0, 0, h, 1, 1, !1), k.firstChild._compMap.Sprite_0.set_visible(!1));
        var n = new ha;
        n.add(new P(function() {
            k._compMap.Sprite_0.scaleX.animateTo(1.15, 0.2, m.backOut);
            k._compMap.Sprite_0.scaleY.animateTo(1.15, 0.2, m.backOut)
        }));
        n.add(new $(0.2));
        n.add(new P(function() {
            k._compMap.Sprite_0.scaleX.animateTo(1, 0.1, m.quadIn);
            k._compMap.Sprite_0.scaleY.animateTo(1, 0.1, m.quadIn)
        }));
        k._compMap.Disposer_2.connect1(k._compMap.Sprite_0.get_pointerDown(),
        function() {
            k._compMap.Script_3.run(n)
        });
        k._compMap.Disposer_2.connect1(k._compMap.Sprite_0.get_pointerUp(),
        function() {
            "" != h && (0 == (k.firstChild._compMap.Sprite_0._flags & 1) ? k.firstChild._compMap.Sprite_0.set_visible(!0) : k.firstChild._compMap.Sprite_0.set_visible(!1));
            "" != e.buttonClickSfx && o.playSfx(e.buttonClickSfx, 0.4);
            null != f && f()
        });
        return k
    };
    e.addDelay = function(a, b, c, d) {
        var e = new G,
        f = new ha;
        f.add(new $(b));
        f.add(new P(function() {
            null != c && c();
            d || e.dispose()
        }));
        b = new ga;
        e.add(new ra);
        e.add(b);
        null != a && a.addChild(e);
        d ? b.run(new zb(f)) : b.run(f);
        return e
    };
    e.rand = function(a) {
        return y.random(a)
    };
    e.randSign = function() {
        var a = 1;
        0 == y.random(2) && (a = -1);
        return a
    };
    e.prototype = {
        onResize: function() {
            var a = l._platform.getStage().get_width(),
            b = l._platform.getStage().get_height(),
            c = Math.min(a / e.width, b / e.height);
            e.director._compMap.Sprite_0.setXY(0.5 * a - 0.5 * c * e.width, 0.5 * b - 0.5 * c * e.height);
            e.director._compMap.Sprite_0.setScale(c);
            var d = e.director._compMap.Sprite_0.x._value,
            f = e.director._compMap.Sprite_0.y._value;
            this.systemBg.setXY(0, 0);
            this.systemBg.setSize(a, b);
            this.leftBorder.setXY(0, f);
            this.leftBorder.setSize(d, b - 2 * f);
            this.rightBorder.setXY(a - d, f);
            this.rightBorder.setSize(d, b - 2 * f);
            this.topBorder.setXY(0, 0);
            this.topBorder.setSize(a, f);
            this.bottomBorder.setXY(0, b - f);
            this.bottomBorder.setSize(a, f);
            e.onResizeCallback();
            this.rotPhonePrompt.setXY(0, 0);
            this.rotPhonePrompt.setSize(l._platform.getStage().get_width(), l._platform.getStage().get_height());
            this.rotPhonePrompt.owner.firstChild._compMap.Sprite_0.setXY(this.rotPhonePrompt.width._value / 2, this.rotPhonePrompt.height._value / 2);
            this.rotPhonePrompt.owner.firstChild._compMap.Sprite_0.setScale(c)
        },
        onOrientationChange: function(a) {
            e.onOrientationChangeCallback();
            e.defaultOrientation != a ? this.rotPhonePrompt.set_visible(!0) : this.rotPhonePrompt.set_visible(!1)
        },
        initPreloaderScene: function() {
            var a = this,
            b = e.width - 150,
            c = (new G).add(new ja),
            d = e.addFillSprite(c, 0, 0, 1118481, e.width, e.height, 1, !1),
            f = e.addFillSprite(d, e.halfWidth, e.halfHeight, 16777215, b, 50),
            h = e.addFillSprite(f, 4, 4, 1118481, 0, 42, 1, !1),
            i = l.loadAssetPack(S.fromAssets("main"));
            i.get(function(b) {
                e.assets = b;
                e.settings = Ua.parse(b.getFile("settings.ini").toString());
                c.removeChild(f);
                a.init.emit()
            });
            i.progressChanged.connect(function() {
                var a = i._progress / i._total;
                1 < a && (a = 1);
                h._compMap.Sprite_0.width.set__(a * (b - 8))
            });
            e.goToScene(c)
        },
        __class__: e
    };
    var ic = 0;
    Math.NaN = Number.NaN;
    Math.NEGATIVE_INFINITY = Number.NEGATIVE_INFINITY;
    Math.POSITIVE_INFINITY = Number.POSITIVE_INFINITY;
    f.Math = Math;
    Math.isFinite = function(a) {
        return isFinite(a)
    };
    Math.isNaN = function(a) {
        return isNaN(a)
    };
    String.prototype.__class__ = f.String = String;
    String.__name__ = ["String"];
    f.Array = Array;
    Array.__name__ = ["Array"];
    Date.prototype.__class__ = f.Date = Date;
    Date.__name__ = ["Date"];
    var jc = f.Int = {
        __name__: ["Int"]
    },
    kc = f.Dynamic = {
        __name__: ["Dynamic"]
    },
    gc = f.Float = Number;
    gc.__name__ = ["Float"];
    var hc = f.Bool = Boolean;
    hc.__ename__ = ["Bool"];
    var lc = f.Class = {
        __name__: ["Class"]
    },
    mc = {};
    X.HI_SCORE = 0;
    i.dirs = [new la(0, -1), new la(0, 1), new la(1, 0), new la( - 1, 0)];
    i.pieceWidth = 70;
    i.pieceHeight = 70;
    i.gap = 0;
    i.offsetX = 0;
    i.offsetY = 220;
    i.pieceTypes = 5;
    i.minMatchForBonus = 6;
    x.canMakeAction = !0;
    na.instance = new na;
    H.DISPATCHING_SENTINEL = new Aa(null, null);
    l.root = new G;
    l.uncaughtError = new A;
    l.hidden = new K(!1);
    l.volume = new B(1);
    l._platform = na.instance;
    l._calledInit = !1;
    S.__meta__ = {
        obj: {
            assets: [{
                main: [{
                    bytes: 4502,
                    md5: "1a07e1b8bd85ac57302a7f6943252f1b",
                    name: "bar1_bg.png"
                },
                {
                    bytes: 3900,
                    md5: "d158ec68f183f19e1a667d33cb2a5e99",
                    name: "bar1_fill.png"
                },
                {
                    bytes: 4282,
                    md5: "b2a3b7fa65a9f33964e3a1753bcbd7f2",
                    name: "bar2_bg.png"
                },
                {
                    bytes: 3665,
                    md5: "db7b4625dc8c124172a30d7248914017",
                    name: "bar2_fill.png"
                },
                {
                    bytes: 10470,
                    md5: "6d8e31007cf845b7a413458015586e7b",
                    name: "bl0.png"
                },
                {
                    bytes: 10144,
                    md5: "dacb277a99d15cdbcc356e3d00b1af3e",
                    name: "bl1.png"
                },
                {
                    bytes: 10448,
                    md5: "c49f2cdd7fd13f28990d61df73f7f1c7",
                    name: "bl2.png"
                },
                {
                    bytes: 9871,
                    md5: "70689a46fd2a9a7228fbb4a174bb245a",
                    name: "bl3.png"
                },
                {
                    bytes: 9981,
                    md5: "7466a42e9c2d50611cf78d22c0d55378",
                    name: "bl4.png"
                },
                {
                    bytes: 9360,
                    md5: "87eb9e9ae2bf7c4bae9c5a70d3623d7c",
                    name: "bl5.png"
                },
                {
                    bytes: 9330,
                    md5: "9ebc4e7a4ae6c923fb2dd5277fec55c6",
                    name: "bl6.png"
                },
                {
                    bytes: 9248,
                    md5: "598433035f5fcbf72949d9b27e2f69b6",
                    name: "bl7.png"
                },
                {
                    bytes: 9237,
                    md5: "23de6d2dc69da478422a56bb4d166752",
                    name: "bl8.png"
                },
                {
                    bytes: 9129,
                    md5: "97bb837096b10a28cda9ab5f3adafe50",
                    name: "bl9.png"
                },
                {
                    bytes: 4492,
                    md5: "1dbd656bdfcd2bdb665d2c0daf8b46e0",
                    name: "bonus_marker.png"
                },
                {
                    bytes: 2797,
                    md5: "60a6a8d9c1630acfc695f5eea0664bce",
                    name: "default_font1.fnt"
                },
                {
                    bytes: 8254,
                    md5: "7f35e4863f2abe5207e4625449183cf0",
                    name: "default_font1.png"
                },
                {
                    bytes: 8620,
                    md5: "dcbd02ae6f63af09d6a7fe617d66c2fe",
                    name: "font2.fnt"
                },
                {
                    bytes: 52839,
                    md5: "508510075cfdc25011c449c5a3dce79e",
                    name: "font2.png"
                },
                {
                    bytes: 2789,
                    md5: "695a163add424d6b95932d8ecfe822e2",
                    name: "font3.fnt"
                },
                {
                    bytes: 7569,
                    md5: "3715a569408118acc6456f1b26f48d07",
                    name: "font3.png"
                },
                {
                    bytes: 215286,
                    md5: "ae4bf05b601d87257526ff0ade180af9",
                    name: "game_scene_bg.png"
                },
                {
                    bytes: 80614,
                    md5: "95bf85cd975bf0ab4c1f184a82a05e00",
                    name: "game_title.png"
                },
                {
                    bytes: 124840,
                    md5: "e57a33a0b70b5e9a7c8fdc41cac906b1",
                    name: "help_info.png"
                },
                {
                    bytes: 12048,
                    md5: "f25d83ad9fa23ebd909eb1f390e1f5c4",
                    name: "home_btn.png"
                },
                {
                    bytes: 3768,
                    md5: "935abfbea4723840a3e86879a7a377bd",
                    name: "hud_bg.png"
                },
                {
                    bytes: 9386,
                    md5: "9c9bea8879710a27ec2ed7dc676c7aba",
                    name: "pause_btn.png"
                },
                {
                    bytes: 17551,
                    md5: "6a40697b164d720c573667f9ccac9d87",
                    name: "play_btn.png"
                },
                {
                    bytes: 19888,
                    md5: "581e716809709e6247b69ad9d3b0ecb5",
                    name: "play_btn2.png"
                },
                {
                    bytes: 9260,
                    md5: "e87c61b2acc5abafa79bfb9529672a71",
                    name: "push_btn.png"
                },
                {
                    bytes: 11724,
                    md5: "9558da2f1295b321c8b9b0bb846f6ade",
                    name: "replay_btn.png"
                },
                {
                    bytes: 8170,
                    md5: "11d79da76c6e9f6d0d4d305f7d111062",
                    name: "score_icon.png"
                },
                {
                    bytes: 12,
                    md5: "dc8056702323802c70172d6227ecff26",
                    name: "settings.ini"
                },
                {
                    bytes: 12139,
                    md5: "8f2205d16e919e14420292efeed78868",
                    name: "sound_off_btn.png"
                },
                {
                    bytes: 12222,
                    md5: "e8d46c16b669fc7ba6ecfa7cecc37778",
                    name: "sound_on_btn.png"
                },
                {
                    bytes: 11319,
                    md5: "101279fccc260cb7badc168e2c1d50b3",
                    name: "sounds/bonus_sfx.mp3"
                },
                {
                    bytes: 15705,
                    md5: "492f3aafc9acc2b8c3b5bad8e2f17747",
                    name: "sounds/button_click_sfx.mp3"
                },
                {
                    bytes: 57710,
                    md5: "0f9d57525bd6973c3b40a133ebd1dd12",
                    name: "sounds/game_over_sfx.mp3"
                },
                {
                    bytes: 74010,
                    md5: "a8a348dd23303bf14ad040ce7e9b0856",
                    name: "sounds/level_end_sfx.mp3"
                },
                {
                    bytes: 8182,
                    md5: "0a371ce975a643d632f309a20a0eb90f",
                    name: "sounds/no_match_sfx.mp3"
                },
                {
                    bytes: 16332,
                    md5: "37f74f6a6c5a74b34213e1880f5c1477",
                    name: "sounds/pop_sfx.mp3"
                },
                {
                    bytes: 385324,
                    md5: "4ebc4263412e80d7ff60ed3ac82e01a2",
                    name: "sounds/soundtrack1.mp3"
                },
                {
                    bytes: 49489,
                    md5: "662133e46b53ed6e96a34a220051dfa5",
                    name: "spikes_block.png"
                }],
                boot: [{
                    bytes: 12539,
                    md5: "8ff68b1f9e1dc38d7cb46c0defb7539e",
                    name: "rot_phone.png"
                }]
            }]
        }
    };
    S._supportsCrossOrigin = function() {
        var a;
        a = 0 <= window.navigator.userAgent.indexOf("Linux; U; Android") ? !1 : null != (new XMLHttpRequest).withCredentials;
        a || null;
        return a
    } ();
    r._scratchPoint = new la;
    Ba.NEWLINE = new gb(10);
    U._sharedEvent = new Kb;
    I._sharedEvent = new Lb;
    za.CANVAS_TEXTURES = (new W("(iPhone|iPod|iPad)", "")).match(window.navigator.userAgent);
    u._mediaRefCount = 0;
    u._detectBlobSupport = !0;
    n.VENDOR_PREFIXES = ["webkit", "moz", "ms", "o", "khtml"];
    n.SHOULD_HIDE_MOBILE_BROWSER = window.top == window && (new W("Mobile(/.*)? Safari", "")).match(window.navigator.userAgent);
    s._detectSupport = !0;
    ia.USE_CACHE = !1;
    ia.USE_ENUM_INDEX = !1;
    ia.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
    O.DEFAULT_RESOLVER = D;
    O.BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789%:";
    wa.count = 0;
    w.cLevel = 1;
    o.soundsFolder = "sounds";
    o.isMuted = !1;
    e.defaultOrientation = ea.Portrait;
    e.defaultFont = "default_font1";
    e.systemBgColor = 0;
    e.buttonClickSfx = "";
    Wa.main()
})();